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

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

Issue 1296663003: Componentize proxy code from chrome/browser/net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated build errors Created 5 years, 4 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/strings/string_number_conversions.h" 6 #include "base/strings/string_number_conversions.h"
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/extensions/dev_mode_bubble_controller.h" 10 #include "chrome/browser/extensions/dev_mode_bubble_controller.h"
11 #include "chrome/browser/extensions/extension_function_test_utils.h" 11 #include "chrome/browser/extensions/extension_function_test_utils.h"
12 #include "chrome/browser/extensions/extension_message_bubble.h" 12 #include "chrome/browser/extensions/extension_message_bubble.h"
13 #include "chrome/browser/extensions/extension_service.h" 13 #include "chrome/browser/extensions/extension_service.h"
14 #include "chrome/browser/extensions/ntp_overridden_bubble_controller.h" 14 #include "chrome/browser/extensions/ntp_overridden_bubble_controller.h"
15 #include "chrome/browser/extensions/proxy_overridden_bubble_controller.h" 15 #include "chrome/browser/extensions/proxy_overridden_bubble_controller.h"
16 #include "chrome/browser/extensions/settings_api_bubble_controller.h" 16 #include "chrome/browser/extensions/settings_api_bubble_controller.h"
17 #include "chrome/browser/extensions/suspicious_extension_bubble_controller.h" 17 #include "chrome/browser/extensions/suspicious_extension_bubble_controller.h"
18 #include "chrome/browser/extensions/test_extension_system.h" 18 #include "chrome/browser/extensions/test_extension_system.h"
19 #include "chrome/common/pref_names.h" 19 #include "chrome/common/pref_names.h"
stevenjb 2015/08/19 15:44:46 Still needed?
Abhishek 2015/08/20 14:14:50 Done.
20 #include "chrome/test/base/browser_with_test_window_test.h" 20 #include "chrome/test/base/browser_with_test_window_test.h"
21 #include "chrome/test/base/testing_profile.h" 21 #include "chrome/test/base/testing_profile.h"
22 #include "components/proxy_config/proxy_config_pref_names.h"
22 #include "content/public/test/test_browser_thread_bundle.h" 23 #include "content/public/test/test_browser_thread_bundle.h"
23 #include "extensions/browser/api_test_utils.h" 24 #include "extensions/browser/api_test_utils.h"
24 #include "extensions/browser/extension_pref_value_map.h" 25 #include "extensions/browser/extension_pref_value_map.h"
25 #include "extensions/browser/extension_pref_value_map_factory.h" 26 #include "extensions/browser/extension_pref_value_map_factory.h"
26 #include "extensions/browser/extension_prefs.h" 27 #include "extensions/browser/extension_prefs.h"
27 #include "extensions/browser/extension_registry.h" 28 #include "extensions/browser/extension_registry.h"
28 #include "extensions/browser/extension_system.h" 29 #include "extensions/browser/extension_system.h"
29 #include "extensions/browser/uninstall_reason.h" 30 #include "extensions/browser/uninstall_reason.h"
30 #include "extensions/common/extension.h" 31 #include "extensions/common/extension.h"
31 #include "extensions/common/extension_builder.h" 32 #include "extensions/common/extension_builder.h"
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 // specifying which extension is controlling the proxy, but unfortunately 361 // specifying which extension is controlling the proxy, but unfortunately
361 // that Map is not updated automatically for unit tests, so we simulate the 362 // that Map is not updated automatically for unit tests, so we simulate the
362 // update here to avoid test failures. 363 // update here to avoid test failures.
363 ExtensionPrefValueMap* extension_prefs_value_map = 364 ExtensionPrefValueMap* extension_prefs_value_map =
364 ExtensionPrefValueMapFactory::GetForBrowserContext(profile()); 365 ExtensionPrefValueMapFactory::GetForBrowserContext(profile());
365 extension_prefs_value_map->RegisterExtension( 366 extension_prefs_value_map->RegisterExtension(
366 id, 367 id,
367 base::Time::Now(), 368 base::Time::Now(),
368 true, // is_enabled. 369 true, // is_enabled.
369 false); // is_incognito_enabled. 370 false); // is_incognito_enabled.
370 extension_prefs_value_map->SetExtensionPref(id, 371 extension_prefs_value_map->SetExtensionPref(id, ProxyPrefs::prefs::kProxy,
371 prefs::kProxy,
372 kExtensionPrefsScopeRegular, 372 kExtensionPrefsScopeRegular,
373 new base::StringValue(id)); 373 new base::StringValue(id));
374 374
375 if (ExtensionRegistry::Get(profile())->enabled_extensions().GetByID(id)) 375 if (ExtensionRegistry::Get(profile())->enabled_extensions().GetByID(id))
376 return testing::AssertionSuccess(); 376 return testing::AssertionSuccess();
377 return testing::AssertionFailure() << "Could not install extension: " << id; 377 return testing::AssertionFailure() << "Could not install extension: " << id;
378 } 378 }
379 379
380 void Init() { 380 void Init() {
381 // The two lines of magical incantation required to get the extension 381 // The two lines of magical incantation required to get the extension
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 extensions::UNINSTALL_REASON_FOR_TESTING, 950 extensions::UNINSTALL_REASON_FOR_TESTING,
951 base::Bind(&base::DoNothing), 951 base::Bind(&base::DoNothing),
952 NULL); 952 NULL);
953 service_->UninstallExtension(kId3, 953 service_->UninstallExtension(kId3,
954 extensions::UNINSTALL_REASON_FOR_TESTING, 954 extensions::UNINSTALL_REASON_FOR_TESTING,
955 base::Bind(&base::DoNothing), 955 base::Bind(&base::DoNothing),
956 NULL); 956 NULL);
957 } 957 }
958 958
959 } // namespace extensions 959 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/settings_private/prefs_util.cc ('k') | chrome/browser/extensions/settings_api_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698