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

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

Issue 12091115: Allow manifest handlers to declare keys they depend on that must be parsed before them. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dcronin 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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 } 532 }
533 533
534 // static 534 // static
535 void ExtensionServiceTestBase::SetUpTestCase() { 535 void ExtensionServiceTestBase::SetUpTestCase() {
536 ExtensionErrorReporter::Init(false); // no noisy errors 536 ExtensionErrorReporter::Init(false); // no noisy errors
537 } 537 }
538 538
539 void ExtensionServiceTestBase::SetUp() { 539 void ExtensionServiceTestBase::SetUp() {
540 testing::Test::SetUp(); 540 testing::Test::SetUp();
541 ExtensionErrorReporter::GetInstance()->ClearErrors(); 541 ExtensionErrorReporter::GetInstance()->ClearErrors();
542 extensions::ManifestHandler::ClearRegistryForTesting();
542 extensions::ManifestHandler::Register( 543 extensions::ManifestHandler::Register(
543 keys::kDefaultLocale, 544 keys::kDefaultLocale,
544 new extensions::DefaultLocaleHandler); 545 make_linked_ptr(new extensions::DefaultLocaleHandler));
545 } 546 }
546 547
547 class ExtensionServiceTest 548 class ExtensionServiceTest
548 : public ExtensionServiceTestBase, public content::NotificationObserver { 549 : public ExtensionServiceTestBase, public content::NotificationObserver {
549 public: 550 public:
550 ExtensionServiceTest() 551 ExtensionServiceTest()
551 : installed_(NULL), 552 : installed_(NULL),
552 override_external_install_prompt_( 553 override_external_install_prompt_(
553 FeatureSwitch::prompt_for_external_extensions(), false) { 554 FeatureSwitch::prompt_for_external_extensions(), false) {
554 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, 555 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
(...skipping 5283 matching lines...) Expand 10 before | Expand all | Expand 10 after
5838 EXPECT_FALSE(extensions::HasExternalInstallError(service_)); 5839 EXPECT_FALSE(extensions::HasExternalInstallError(service_));
5839 EXPECT_FALSE(service_->IsExtensionEnabled(good_crx)); 5840 EXPECT_FALSE(service_->IsExtensionEnabled(good_crx));
5840 EXPECT_TRUE(service_->IsExtensionEnabled(page_action)); 5841 EXPECT_TRUE(service_->IsExtensionEnabled(page_action));
5841 5842
5842 ExtensionPrefs* prefs = service_->extension_prefs(); 5843 ExtensionPrefs* prefs = service_->extension_prefs();
5843 EXPECT_NE(0, prefs->GetDisableReasons(good_crx) & 5844 EXPECT_NE(0, prefs->GetDisableReasons(good_crx) &
5844 Extension::DISABLE_SIDELOAD_WIPEOUT); 5845 Extension::DISABLE_SIDELOAD_WIPEOUT);
5845 EXPECT_EQ(0, prefs->GetDisableReasons(page_action) & 5846 EXPECT_EQ(0, prefs->GetDisableReasons(page_action) &
5846 Extension::DISABLE_SIDELOAD_WIPEOUT); 5847 Extension::DISABLE_SIDELOAD_WIPEOUT);
5847 } 5848 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698