| OLD | NEW |
| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 #include "content/public/common/content_paths.h" | 125 #include "content/public/common/content_paths.h" |
| 126 #include "content/public/common/process_type.h" | 126 #include "content/public/common/process_type.h" |
| 127 #include "content/public/common/result_codes.h" | 127 #include "content/public/common/result_codes.h" |
| 128 #include "content/public/common/url_constants.h" | 128 #include "content/public/common/url_constants.h" |
| 129 #include "content/public/common/webplugininfo.h" | 129 #include "content/public/common/webplugininfo.h" |
| 130 #include "content/public/test/browser_test_utils.h" | 130 #include "content/public/test/browser_test_utils.h" |
| 131 #include "content/public/test/download_test_observer.h" | 131 #include "content/public/test/download_test_observer.h" |
| 132 #include "content/public/test/mock_notification_observer.h" | 132 #include "content/public/test/mock_notification_observer.h" |
| 133 #include "content/public/test/test_navigation_observer.h" | 133 #include "content/public/test/test_navigation_observer.h" |
| 134 #include "content/public/test/test_utils.h" | 134 #include "content/public/test/test_utils.h" |
| 135 #include "extensions/browser/extension_dialog_auto_confirm.h" |
| 135 #include "extensions/browser/extension_host.h" | 136 #include "extensions/browser/extension_host.h" |
| 136 #include "extensions/browser/extension_prefs.h" | 137 #include "extensions/browser/extension_prefs.h" |
| 137 #include "extensions/browser/extension_registry.h" | 138 #include "extensions/browser/extension_registry.h" |
| 138 #include "extensions/browser/extension_system.h" | 139 #include "extensions/browser/extension_system.h" |
| 139 #include "extensions/browser/process_manager.h" | 140 #include "extensions/browser/process_manager.h" |
| 140 #include "extensions/browser/test_extension_registry_observer.h" | 141 #include "extensions/browser/test_extension_registry_observer.h" |
| 141 #include "extensions/browser/uninstall_reason.h" | 142 #include "extensions/browser/uninstall_reason.h" |
| 142 #include "extensions/common/constants.h" | 143 #include "extensions/common/constants.h" |
| 143 #include "extensions/common/extension.h" | 144 #include "extensions/common/extension.h" |
| 144 #include "extensions/common/extension_set.h" | 145 #include "extensions/common/extension_set.h" |
| (...skipping 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1961 // Checks that a click on an extension CRX download triggers the extension | 1962 // Checks that a click on an extension CRX download triggers the extension |
| 1962 // installation prompt without further user interaction when the source is | 1963 // installation prompt without further user interaction when the source is |
| 1963 // whitelisted by policy. | 1964 // whitelisted by policy. |
| 1964 // Flaky on windows; http://crbug.com/295729 . | 1965 // Flaky on windows; http://crbug.com/295729 . |
| 1965 #if defined(OS_WIN) | 1966 #if defined(OS_WIN) |
| 1966 #define MAYBE_ExtensionInstallSources DISABLED_ExtensionInstallSources | 1967 #define MAYBE_ExtensionInstallSources DISABLED_ExtensionInstallSources |
| 1967 #else | 1968 #else |
| 1968 #define MAYBE_ExtensionInstallSources ExtensionInstallSources | 1969 #define MAYBE_ExtensionInstallSources ExtensionInstallSources |
| 1969 #endif | 1970 #endif |
| 1970 IN_PROC_BROWSER_TEST_F(PolicyTest, MAYBE_ExtensionInstallSources) { | 1971 IN_PROC_BROWSER_TEST_F(PolicyTest, MAYBE_ExtensionInstallSources) { |
| 1971 ExtensionInstallPrompt::g_auto_confirm_for_tests = | 1972 extensions::ScopedTestDialogAutoConfirm auto_confirm( |
| 1972 ExtensionInstallPrompt::ACCEPT; | 1973 extensions::ScopedTestDialogAutoConfirm::ACCEPT); |
| 1973 | 1974 |
| 1974 const GURL install_source_url(URLRequestMockHTTPJob::GetMockUrl( | 1975 const GURL install_source_url(URLRequestMockHTTPJob::GetMockUrl( |
| 1975 base::FilePath(FILE_PATH_LITERAL("extensions/*")))); | 1976 base::FilePath(FILE_PATH_LITERAL("extensions/*")))); |
| 1976 const GURL referrer_url(URLRequestMockHTTPJob::GetMockUrl( | 1977 const GURL referrer_url(URLRequestMockHTTPJob::GetMockUrl( |
| 1977 base::FilePath(FILE_PATH_LITERAL("policy/*")))); | 1978 base::FilePath(FILE_PATH_LITERAL("policy/*")))); |
| 1978 | 1979 |
| 1979 base::ScopedTempDir download_directory; | 1980 base::ScopedTempDir download_directory; |
| 1980 ASSERT_TRUE(download_directory.CreateUniqueTempDir()); | 1981 ASSERT_TRUE(download_directory.CreateUniqueTempDir()); |
| 1981 DownloadPrefs* download_prefs = | 1982 DownloadPrefs* download_prefs = |
| 1982 DownloadPrefs::FromBrowserContext(browser()->profile()); | 1983 DownloadPrefs::FromBrowserContext(browser()->profile()); |
| (...skipping 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3830 PrefService* prefs = browser()->profile()->GetPrefs(); | 3831 PrefService* prefs = browser()->profile()->GetPrefs(); |
| 3831 EXPECT_TRUE(extensions::MessageService::IsNativeMessagingHostAllowed( | 3832 EXPECT_TRUE(extensions::MessageService::IsNativeMessagingHostAllowed( |
| 3832 prefs, "host.name")); | 3833 prefs, "host.name")); |
| 3833 EXPECT_FALSE(extensions::MessageService::IsNativeMessagingHostAllowed( | 3834 EXPECT_FALSE(extensions::MessageService::IsNativeMessagingHostAllowed( |
| 3834 prefs, "other.host.name")); | 3835 prefs, "other.host.name")); |
| 3835 } | 3836 } |
| 3836 | 3837 |
| 3837 #endif // !defined(CHROME_OS) | 3838 #endif // !defined(CHROME_OS) |
| 3838 | 3839 |
| 3839 } // namespace policy | 3840 } // namespace policy |
| OLD | NEW |