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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/extensions/crx_installer.h" | 9 #include "chrome/browser/extensions/crx_installer.h" |
10 #include "chrome/browser/extensions/extension_browsertest.h" | 10 #include "chrome/browser/extensions/extension_browsertest.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 ui_test_utils::NavigateToURL(browser(), | 96 ui_test_utils::NavigateToURL(browser(), |
97 extension->GetResourceURL("test.html")); | 97 extension->GetResourceURL("test.html")); |
98 // Don't run tests if the NaCl plugin isn't loaded. | 98 // Don't run tests if the NaCl plugin isn't loaded. |
99 if (!IsNaClPluginLoaded()) | 99 if (!IsNaClPluginLoaded()) |
100 return; | 100 return; |
101 | 101 |
102 bool embedded_plugin_created = false; | 102 bool embedded_plugin_created = false; |
103 bool content_handler_plugin_created = false; | 103 bool content_handler_plugin_created = false; |
104 WebContents* web_contents = chrome::GetActiveWebContents(browser()); | 104 WebContents* web_contents = chrome::GetActiveWebContents(browser()); |
105 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( | 105 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( |
106 web_contents->GetRenderViewHost(), L"", | 106 web_contents->GetRenderViewHost(), |
107 L"window.domAutomationController.send(EmbeddedPluginCreated());", | 107 "", |
| 108 "window.domAutomationController.send(EmbeddedPluginCreated());", |
108 &embedded_plugin_created)); | 109 &embedded_plugin_created)); |
109 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( | 110 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( |
110 web_contents->GetRenderViewHost(), L"", | 111 web_contents->GetRenderViewHost(), |
111 L"window.domAutomationController.send(ContentHandlerPluginCreated());", | 112 "", |
| 113 "window.domAutomationController.send(ContentHandlerPluginCreated());", |
112 &content_handler_plugin_created)); | 114 &content_handler_plugin_created)); |
113 | 115 |
114 EXPECT_EQ(should_create, embedded_plugin_created); | 116 EXPECT_EQ(should_create, embedded_plugin_created); |
115 EXPECT_EQ(should_create, content_handler_plugin_created); | 117 EXPECT_EQ(should_create, content_handler_plugin_created); |
116 } | 118 } |
117 }; | 119 }; |
118 | 120 |
119 // Test that the NaCl plugin isn't blocked for Webstore extensions. | 121 // Test that the NaCl plugin isn't blocked for Webstore extensions. |
120 IN_PROC_BROWSER_TEST_F(NaClExtensionTest, WebStoreExtension) { | 122 IN_PROC_BROWSER_TEST_F(NaClExtensionTest, WebStoreExtension) { |
121 ASSERT_TRUE(test_server()->Start()); | 123 ASSERT_TRUE(test_server()->Start()); |
(...skipping 26 matching lines...) Expand all Loading... |
148 IN_PROC_BROWSER_TEST_F(NaClExtensionTest, UnpackedExtension) { | 150 IN_PROC_BROWSER_TEST_F(NaClExtensionTest, UnpackedExtension) { |
149 ASSERT_TRUE(test_server()->Start()); | 151 ASSERT_TRUE(test_server()->Start()); |
150 | 152 |
151 const Extension* extension = InstallExtension(INSTALL_TYPE_UNPACKED); | 153 const Extension* extension = InstallExtension(INSTALL_TYPE_UNPACKED); |
152 ASSERT_TRUE(extension); | 154 ASSERT_TRUE(extension); |
153 ASSERT_EQ(extension->location(), Extension::LOAD); | 155 ASSERT_EQ(extension->location(), Extension::LOAD); |
154 CheckPluginsCreated(extension, true); | 156 CheckPluginsCreated(extension, true); |
155 } | 157 } |
156 | 158 |
157 } // namespace | 159 } // namespace |
OLD | NEW |