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

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

Issue 12025010: Move default_locale out of Extension class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: extension_service_unittest fixed 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
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 #include "chrome/browser/extensions/unpacked_installer.h" 55 #include "chrome/browser/extensions/unpacked_installer.h"
56 #include "chrome/browser/extensions/updater/extension_updater.h" 56 #include "chrome/browser/extensions/updater/extension_updater.h"
57 #include "chrome/browser/plugins/plugin_prefs_factory.h" 57 #include "chrome/browser/plugins/plugin_prefs_factory.h"
58 #include "chrome/browser/prefs/browser_prefs.h" 58 #include "chrome/browser/prefs/browser_prefs.h"
59 #include "chrome/browser/prefs/pref_service_mock_builder.h" 59 #include "chrome/browser/prefs/pref_service_mock_builder.h"
60 #include "chrome/browser/prefs/scoped_user_pref_update.h" 60 #include "chrome/browser/prefs/scoped_user_pref_update.h"
61 #include "chrome/common/chrome_constants.h" 61 #include "chrome/common/chrome_constants.h"
62 #include "chrome/common/chrome_notification_types.h" 62 #include "chrome/common/chrome_notification_types.h"
63 #include "chrome/common/chrome_paths.h" 63 #include "chrome/common/chrome_paths.h"
64 #include "chrome/common/chrome_switches.h" 64 #include "chrome/common/chrome_switches.h"
65 #include "chrome/common/extensions/api/i18n/default_locale_handler.h"
65 #include "chrome/common/extensions/extension.h" 66 #include "chrome/common/extensions/extension.h"
66 #include "chrome/common/extensions/extension_l10n_util.h" 67 #include "chrome/common/extensions/extension_l10n_util.h"
67 #include "chrome/common/extensions/extension_manifest_constants.h" 68 #include "chrome/common/extensions/extension_manifest_constants.h"
68 #include "chrome/common/extensions/extension_resource.h" 69 #include "chrome/common/extensions/extension_resource.h"
70 #include "chrome/common/extensions/manifest_handler.h"
69 #include "chrome/common/extensions/manifest_url_handler.h" 71 #include "chrome/common/extensions/manifest_url_handler.h"
70 #include "chrome/common/extensions/permissions/permission_set.h" 72 #include "chrome/common/extensions/permissions/permission_set.h"
71 #include "chrome/common/pref_names.h" 73 #include "chrome/common/pref_names.h"
72 #include "chrome/common/url_constants.h" 74 #include "chrome/common/url_constants.h"
73 #include "chrome/test/base/testing_profile.h" 75 #include "chrome/test/base/testing_profile.h"
74 #include "content/public/browser/dom_storage_context.h" 76 #include "content/public/browser/dom_storage_context.h"
75 #include "content/public/browser/gpu_data_manager.h" 77 #include "content/public/browser/gpu_data_manager.h"
76 #include "content/public/browser/indexed_db_context.h" 78 #include "content/public/browser/indexed_db_context.h"
77 #include "content/public/browser/notification_registrar.h" 79 #include "content/public/browser/notification_registrar.h"
78 #include "content/public/browser/notification_service.h" 80 #include "content/public/browser/notification_service.h"
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 static_cast<TestingProfile*>(profile_.get()); 529 static_cast<TestingProfile*>(profile_.get());
528 profile->CreateRequestContext(); 530 profile->CreateRequestContext();
529 } 531 }
530 532
531 // static 533 // static
532 void ExtensionServiceTestBase::SetUpTestCase() { 534 void ExtensionServiceTestBase::SetUpTestCase() {
533 ExtensionErrorReporter::Init(false); // no noisy errors 535 ExtensionErrorReporter::Init(false); // no noisy errors
534 } 536 }
535 537
536 void ExtensionServiceTestBase::SetUp() { 538 void ExtensionServiceTestBase::SetUp() {
539 testing::Test::SetUp();
537 ExtensionErrorReporter::GetInstance()->ClearErrors(); 540 ExtensionErrorReporter::GetInstance()->ClearErrors();
541 extensions::ManifestHandler::Register(
542 keys::kDefaultLocale,
543 new extensions::DefaultLocaleHandler);
538 } 544 }
539 545
540 class ExtensionServiceTest 546 class ExtensionServiceTest
541 : public ExtensionServiceTestBase, public content::NotificationObserver { 547 : public ExtensionServiceTestBase, public content::NotificationObserver {
542 public: 548 public:
543 ExtensionServiceTest() 549 ExtensionServiceTest()
544 : installed_(NULL), 550 : installed_(NULL),
545 override_external_install_prompt_( 551 override_external_install_prompt_(
546 FeatureSwitch::prompt_for_external_extensions(), false) { 552 FeatureSwitch::prompt_for_external_extensions(), false) {
547 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, 553 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
(...skipping 5283 matching lines...) Expand 10 before | Expand all | Expand 10 after
5831 EXPECT_FALSE(extensions::HasExternalInstallError(service_)); 5837 EXPECT_FALSE(extensions::HasExternalInstallError(service_));
5832 EXPECT_FALSE(service_->IsExtensionEnabled(good_crx)); 5838 EXPECT_FALSE(service_->IsExtensionEnabled(good_crx));
5833 EXPECT_TRUE(service_->IsExtensionEnabled(page_action)); 5839 EXPECT_TRUE(service_->IsExtensionEnabled(page_action));
5834 5840
5835 ExtensionPrefs* prefs = service_->extension_prefs(); 5841 ExtensionPrefs* prefs = service_->extension_prefs();
5836 EXPECT_NE(0, prefs->GetDisableReasons(good_crx) & 5842 EXPECT_NE(0, prefs->GetDisableReasons(good_crx) &
5837 Extension::DISABLE_SIDELOAD_WIPEOUT); 5843 Extension::DISABLE_SIDELOAD_WIPEOUT);
5838 EXPECT_EQ(0, prefs->GetDisableReasons(page_action) & 5844 EXPECT_EQ(0, prefs->GetDisableReasons(page_action) &
5839 Extension::DISABLE_SIDELOAD_WIPEOUT); 5845 Extension::DISABLE_SIDELOAD_WIPEOUT);
5840 } 5846 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_api.cc ('k') | chrome/browser/extensions/sandboxed_unpacker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698