Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Side by Side Diff: chrome/browser/extensions/content_script_apitest.cc

Issue 11728003: Change ExecuteJavaScript* helper functions in browser_test_utils.{h,cc} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding files for gpu_tests and NaCl browser tests. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/utf_string_conversions.h" 5 #include "base/utf_string_conversions.h"
6 #include "chrome/browser/extensions/api/permissions/permissions_api.h" 6 #include "chrome/browser/extensions/api/permissions/permissions_api.h"
7 #include "chrome/browser/extensions/extension_apitest.h" 7 #include "chrome/browser/extensions/extension_apitest.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_tabstrip.h" 10 #include "chrome/browser/ui/browser_tabstrip.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 ui_test_utils::NavigateToURL(browser(), url); 117 ui_test_utils::NavigateToURL(browser(), url);
118 118
119 LoadExtension( 119 LoadExtension(
120 test_data_dir_.AppendASCII("content_scripts/existing_renderers")); 120 test_data_dir_.AppendASCII("content_scripts/existing_renderers"));
121 121
122 signal.Wait(); 122 signal.Wait();
123 123
124 // And check that its styles were affected by the styles that just got loaded. 124 // And check that its styles were affected by the styles that just got loaded.
125 bool styles_injected; 125 bool styles_injected;
126 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( 126 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool(
127 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), L"", 127 chrome::GetActiveWebContents(browser())->GetRenderViewHost(),
128 L"window.domAutomationController.send(" 128 "",
129 L"document.defaultView.getComputedStyle(document.body, null)." 129 "window.domAutomationController.send("
130 L"getPropertyValue('background-color') == 'rgb(255, 0, 0)')", 130 " document.defaultView.getComputedStyle(document.body, null)."
131 " getPropertyValue('background-color') == 'rgb(255, 0, 0)')",
131 &styles_injected)); 132 &styles_injected));
132 ASSERT_TRUE(styles_injected); 133 ASSERT_TRUE(styles_injected);
133 } 134 }
134 135
135 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, 136 IN_PROC_BROWSER_TEST_F(ExtensionApiTest,
136 ContentScriptCSSLocalization) { 137 ContentScriptCSSLocalization) {
137 ASSERT_TRUE(StartTestServer()); 138 ASSERT_TRUE(StartTestServer());
138 ASSERT_TRUE(RunExtensionTest("content_scripts/css_l10n")) << message_; 139 ASSERT_TRUE(RunExtensionTest("content_scripts/css_l10n")) << message_;
139 } 140 }
140 141
(...skipping 26 matching lines...) Expand all
167 RequestPermissionsFunction::SetAutoConfirmForTests(true); 168 RequestPermissionsFunction::SetAutoConfirmForTests(true);
168 host_resolver()->AddRule("*.com", "127.0.0.1"); 169 host_resolver()->AddRule("*.com", "127.0.0.1");
169 ASSERT_TRUE(StartTestServer()); 170 ASSERT_TRUE(StartTestServer());
170 ASSERT_TRUE(RunExtensionTest("content_scripts/permissions")) << message_; 171 ASSERT_TRUE(RunExtensionTest("content_scripts/permissions")) << message_;
171 } 172 }
172 173
173 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptBypassPageCSP) { 174 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptBypassPageCSP) {
174 ASSERT_TRUE(StartTestServer()); 175 ASSERT_TRUE(StartTestServer());
175 ASSERT_TRUE(RunExtensionTest("content_scripts/bypass_page_csp")) << message_; 176 ASSERT_TRUE(RunExtensionTest("content_scripts/bypass_page_csp")) << message_;
176 } 177 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698