| OLD | NEW |
| 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" |
| 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_prefs.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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, |
| 371 prefs::kProxy, | 372 ProxyPrefs::kProxy, |
| 372 kExtensionPrefsScopeRegular, | 373 kExtensionPrefsScopeRegular, |
| 373 new base::StringValue(id)); | 374 new base::StringValue(id)); |
| 374 | 375 |
| 375 if (ExtensionRegistry::Get(profile())->enabled_extensions().GetByID(id)) | 376 if (ExtensionRegistry::Get(profile())->enabled_extensions().GetByID(id)) |
| 376 return testing::AssertionSuccess(); | 377 return testing::AssertionSuccess(); |
| 377 return testing::AssertionFailure() << "Could not install extension: " << id; | 378 return testing::AssertionFailure() << "Could not install extension: " << id; |
| 378 } | 379 } |
| 379 | 380 |
| 380 void Init() { | 381 void Init() { |
| 381 // The two lines of magical incantation required to get the extension | 382 // The two lines of magical incantation required to get the extension |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 950 extensions::UNINSTALL_REASON_FOR_TESTING, | 951 extensions::UNINSTALL_REASON_FOR_TESTING, |
| 951 base::Bind(&base::DoNothing), | 952 base::Bind(&base::DoNothing), |
| 952 NULL); | 953 NULL); |
| 953 service_->UninstallExtension(kId3, | 954 service_->UninstallExtension(kId3, |
| 954 extensions::UNINSTALL_REASON_FOR_TESTING, | 955 extensions::UNINSTALL_REASON_FOR_TESTING, |
| 955 base::Bind(&base::DoNothing), | 956 base::Bind(&base::DoNothing), |
| 956 NULL); | 957 NULL); |
| 957 } | 958 } |
| 958 | 959 |
| 959 } // namespace extensions | 960 } // namespace extensions |
| OLD | NEW |