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 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1821 SetRestartDelayForForceInstalledAppsAndExtensionsForTesting(0); | 1821 SetRestartDelayForForceInstalledAppsAndExtensionsForTesting(0); |
1822 content::WindowedNotificationObserver extension_crashed_observer( | 1822 content::WindowedNotificationObserver extension_crashed_observer( |
1823 extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, | 1823 extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, |
1824 content::NotificationService::AllSources()); | 1824 content::NotificationService::AllSources()); |
1825 content::WindowedNotificationObserver extension_loaded_observer( | 1825 content::WindowedNotificationObserver extension_loaded_observer( |
1826 extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, | 1826 extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, |
1827 content::NotificationService::AllSources()); | 1827 content::NotificationService::AllSources()); |
1828 extensions::ExtensionHost* extension_host = | 1828 extensions::ExtensionHost* extension_host = |
1829 extensions::ProcessManager::Get(browser()->profile()) | 1829 extensions::ProcessManager::Get(browser()->profile()) |
1830 ->GetBackgroundHostForExtension(kGoodCrxId); | 1830 ->GetBackgroundHostForExtension(kGoodCrxId); |
1831 base::KillProcess(extension_host->render_process_host()->GetHandle(), | 1831 extension_host->render_process_host()->Shutdown(content::RESULT_CODE_KILLED, |
1832 content::RESULT_CODE_KILLED, false); | 1832 false); |
1833 extension_crashed_observer.Wait(); | 1833 extension_crashed_observer.Wait(); |
1834 extension_loaded_observer.Wait(); | 1834 extension_loaded_observer.Wait(); |
1835 } | 1835 } |
1836 | 1836 |
1837 IN_PROC_BROWSER_TEST_F(PolicyTest, ExtensionRecommendedInstallationMode) { | 1837 IN_PROC_BROWSER_TEST_F(PolicyTest, ExtensionRecommendedInstallationMode) { |
1838 // Verifies that extensions that are recommended-installed by policies are | 1838 // Verifies that extensions that are recommended-installed by policies are |
1839 // installed, can be disabled but not uninstalled. | 1839 // installed, can be disabled but not uninstalled. |
1840 ExtensionService* service = extension_service(); | 1840 ExtensionService* service = extension_service(); |
1841 ASSERT_FALSE(service->GetExtensionById(kGoodCrxId, true)); | 1841 ASSERT_FALSE(service->GetExtensionById(kGoodCrxId, true)); |
1842 | 1842 |
(...skipping 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3435 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( | 3435 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( |
3436 browser2->tab_strip_model()->GetActiveWebContents(), | 3436 browser2->tab_strip_model()->GetActiveWebContents(), |
3437 "domAutomationController.send(window.showModalDialog !== undefined);", | 3437 "domAutomationController.send(window.showModalDialog !== undefined);", |
3438 &result)); | 3438 &result)); |
3439 EXPECT_TRUE(result); | 3439 EXPECT_TRUE(result); |
3440 } | 3440 } |
3441 | 3441 |
3442 #endif // !defined(CHROME_OS) | 3442 #endif // !defined(CHROME_OS) |
3443 | 3443 |
3444 } // namespace policy | 3444 } // namespace policy |
OLD | NEW |