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