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

Side by Side Diff: content/browser/site_per_process_browsertest.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
« no previous file with comments | « content/browser/session_history_browsertest.cc ('k') | content/browser/webrtc_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/stringprintf.h" 6 #include "base/stringprintf.h"
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "content/browser/web_contents/web_contents_impl.h" 8 #include "content/browser/web_contents/web_contents_impl.h"
9 #include "content/public/browser/notification_observer.h" 9 #include "content/public/browser/notification_observer.h"
10 #include "content/public/browser/notification_service.h" 10 #include "content/public/browser/notification_service.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 const GURL& url, 146 const GURL& url,
147 std::string iframe_id) { 147 std::string iframe_id) {
148 std::string script = base::StringPrintf( 148 std::string script = base::StringPrintf(
149 "var iframes = document.getElementById('%s');iframes.src='%s';", 149 "var iframes = document.getElementById('%s');iframes.src='%s';",
150 iframe_id.c_str(), url.spec().c_str()); 150 iframe_id.c_str(), url.spec().c_str());
151 WindowedNotificationObserver load_observer( 151 WindowedNotificationObserver load_observer(
152 NOTIFICATION_LOAD_STOP, 152 NOTIFICATION_LOAD_STOP,
153 Source<NavigationController>( 153 Source<NavigationController>(
154 &shell()->web_contents()->GetController())); 154 &shell()->web_contents()->GetController()));
155 bool result = ExecuteJavaScript(window->web_contents()->GetRenderViewHost(), 155 bool result = ExecuteJavaScript(window->web_contents()->GetRenderViewHost(),
156 L"", ASCIIToWide(script)); 156 "", script);
157 load_observer.Wait(); 157 load_observer.Wait();
158 return result; 158 return result;
159 } 159 }
160 160
161 void SetUpCommandLine(CommandLine* command_line) { 161 void SetUpCommandLine(CommandLine* command_line) {
162 command_line->AppendSwitch(switches::kSitePerProcess); 162 command_line->AppendSwitch(switches::kSitePerProcess);
163 } 163 }
164 }; 164 };
165 165
166 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CrossSiteIframe) { 166 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CrossSiteIframe) {
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 "server-redirect?" + client_redirect_http_url.spec())); 387 "server-redirect?" + client_redirect_http_url.spec()));
388 EXPECT_TRUE(NavigateIframeToURL(shell(), server_redirect_http_url, "test")); 388 EXPECT_TRUE(NavigateIframeToURL(shell(), server_redirect_http_url, "test"));
389 389
390 // DidFailProvisionalLoad when navigating to client_redirect_http_url. 390 // DidFailProvisionalLoad when navigating to client_redirect_http_url.
391 EXPECT_EQ(observer.navigation_url(), client_redirect_http_url); 391 EXPECT_EQ(observer.navigation_url(), client_redirect_http_url);
392 EXPECT_FALSE(observer.navigation_succeeded()); 392 EXPECT_FALSE(observer.navigation_succeeded());
393 } 393 }
394 } 394 }
395 395
396 } 396 }
OLDNEW
« no previous file with comments | « content/browser/session_history_browsertest.cc ('k') | content/browser/webrtc_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698