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 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1812 SetRestartDelayForForceInstalledAppsAndExtensionsForTesting(0); | 1812 SetRestartDelayForForceInstalledAppsAndExtensionsForTesting(0); |
1813 content::WindowedNotificationObserver extension_crashed_observer( | 1813 content::WindowedNotificationObserver extension_crashed_observer( |
1814 extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, | 1814 extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, |
1815 content::NotificationService::AllSources()); | 1815 content::NotificationService::AllSources()); |
1816 content::WindowedNotificationObserver extension_loaded_observer( | 1816 content::WindowedNotificationObserver extension_loaded_observer( |
1817 extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, | 1817 extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, |
1818 content::NotificationService::AllSources()); | 1818 content::NotificationService::AllSources()); |
1819 extensions::ExtensionHost* extension_host = | 1819 extensions::ExtensionHost* extension_host = |
1820 extensions::ProcessManager::Get(browser()->profile()) | 1820 extensions::ProcessManager::Get(browser()->profile()) |
1821 ->GetBackgroundHostForExtension(kGoodCrxId); | 1821 ->GetBackgroundHostForExtension(kGoodCrxId); |
1822 base::KillProcess(extension_host->render_process_host()->GetHandle(), | 1822 extension_host->render_process_host()->FastShutdown( |
1823 content::RESULT_CODE_KILLED, false); | 1823 content::RESULT_CODE_KILLED, false); |
1824 extension_crashed_observer.Wait(); | 1824 extension_crashed_observer.Wait(); |
1825 extension_loaded_observer.Wait(); | 1825 extension_loaded_observer.Wait(); |
1826 } | 1826 } |
1827 | 1827 |
1828 IN_PROC_BROWSER_TEST_F(PolicyTest, ExtensionRecommendedInstallationMode) { | 1828 IN_PROC_BROWSER_TEST_F(PolicyTest, ExtensionRecommendedInstallationMode) { |
1829 // Verifies that extensions that are recommended-installed by policies are | 1829 // Verifies that extensions that are recommended-installed by policies are |
1830 // installed, can be disabled but not uninstalled. | 1830 // installed, can be disabled but not uninstalled. |
1831 ExtensionService* service = extension_service(); | 1831 ExtensionService* service = extension_service(); |
1832 ASSERT_FALSE(service->GetExtensionById(kGoodCrxId, true)); | 1832 ASSERT_FALSE(service->GetExtensionById(kGoodCrxId, true)); |
1833 | 1833 |
(...skipping 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3427 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( | 3427 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( |
3428 browser2->tab_strip_model()->GetActiveWebContents(), | 3428 browser2->tab_strip_model()->GetActiveWebContents(), |
3429 "domAutomationController.send(window.showModalDialog !== undefined);", | 3429 "domAutomationController.send(window.showModalDialog !== undefined);", |
3430 &result)); | 3430 &result)); |
3431 EXPECT_TRUE(result); | 3431 EXPECT_TRUE(result); |
3432 } | 3432 } |
3433 | 3433 |
3434 #endif // !defined(CHROME_OS) | 3434 #endif // !defined(CHROME_OS) |
3435 | 3435 |
3436 } // namespace policy | 3436 } // namespace policy |
OLD | NEW |