Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: chrome/browser/extensions/extension_service_unittest.cc

Issue 12220122: Move calls of ManifestHandler::ClearRegistryForTesting to TearDown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_service_unittest.h" 5 #include "chrome/browser/extensions/extension_service_unittest.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 } 539 }
540 540
541 // static 541 // static
542 void ExtensionServiceTestBase::SetUpTestCase() { 542 void ExtensionServiceTestBase::SetUpTestCase() {
543 ExtensionErrorReporter::Init(false); // no noisy errors 543 ExtensionErrorReporter::Init(false); // no noisy errors
544 } 544 }
545 545
546 void ExtensionServiceTestBase::SetUp() { 546 void ExtensionServiceTestBase::SetUp() {
547 testing::Test::SetUp(); 547 testing::Test::SetUp();
548 ExtensionErrorReporter::GetInstance()->ClearErrors(); 548 ExtensionErrorReporter::GetInstance()->ClearErrors();
549 extensions::ManifestHandler::ClearRegistryForTesting();
550 extensions::ManifestHandler::Register( 549 extensions::ManifestHandler::Register(
551 keys::kDefaultLocale, 550 keys::kDefaultLocale,
552 make_linked_ptr(new extensions::DefaultLocaleHandler)); 551 make_linked_ptr(new extensions::DefaultLocaleHandler));
553 } 552 }
554 553
554 void ExtensionServiceTestBase::TearDown() {
555 extensions::ManifestHandler::ClearRegistryForTesting();
556 }
557
555 class ExtensionServiceTest 558 class ExtensionServiceTest
556 : public ExtensionServiceTestBase, public content::NotificationObserver { 559 : public ExtensionServiceTestBase, public content::NotificationObserver {
557 public: 560 public:
558 ExtensionServiceTest() 561 ExtensionServiceTest()
559 : installed_(NULL), 562 : installed_(NULL),
560 override_external_install_prompt_( 563 override_external_install_prompt_(
561 FeatureSwitch::prompt_for_external_extensions(), false) { 564 FeatureSwitch::prompt_for_external_extensions(), false) {
562 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, 565 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
563 content::NotificationService::AllSources()); 566 content::NotificationService::AllSources());
564 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, 567 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
(...skipping 5291 matching lines...) Expand 10 before | Expand all | Expand 10 after
5856 EXPECT_FALSE(extensions::HasExternalInstallError(service_)); 5859 EXPECT_FALSE(extensions::HasExternalInstallError(service_));
5857 EXPECT_FALSE(service_->IsExtensionEnabled(good_crx)); 5860 EXPECT_FALSE(service_->IsExtensionEnabled(good_crx));
5858 EXPECT_TRUE(service_->IsExtensionEnabled(page_action)); 5861 EXPECT_TRUE(service_->IsExtensionEnabled(page_action));
5859 5862
5860 ExtensionPrefs* prefs = service_->extension_prefs(); 5863 ExtensionPrefs* prefs = service_->extension_prefs();
5861 EXPECT_NE(0, prefs->GetDisableReasons(good_crx) & 5864 EXPECT_NE(0, prefs->GetDisableReasons(good_crx) &
5862 Extension::DISABLE_SIDELOAD_WIPEOUT); 5865 Extension::DISABLE_SIDELOAD_WIPEOUT);
5863 EXPECT_EQ(0, prefs->GetDisableReasons(page_action) & 5866 EXPECT_EQ(0, prefs->GetDisableReasons(page_action) &
5864 Extension::DISABLE_SIDELOAD_WIPEOUT); 5867 Extension::DISABLE_SIDELOAD_WIPEOUT);
5865 } 5868 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.h ('k') | chrome/common/extensions/manifest_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698