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

Side by Side Diff: chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.cc

Issue 1123783002: Add ExecuteJavaScriptForTest and make all tests use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 5 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
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 "chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.h" 5 #include "chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 NEW_BACKGROUND_TAB, 241 NEW_BACKGROUND_TAB,
242 ui_test_utils::BROWSER_TEST_NONE); 242 ui_test_utils::BROWSER_TEST_NONE);
243 } 243 }
244 244
245 void NetInternalsTest::MessageHandler::NavigateToPrerender( 245 void NetInternalsTest::MessageHandler::NavigateToPrerender(
246 const base::ListValue* list_value) { 246 const base::ListValue* list_value) {
247 std::string url; 247 std::string url;
248 ASSERT_TRUE(list_value->GetString(0, &url)); 248 ASSERT_TRUE(list_value->GetString(0, &url));
249 content::RenderFrameHost* frame = 249 content::RenderFrameHost* frame =
250 browser()->tab_strip_model()->GetWebContentsAt(1)->GetMainFrame(); 250 browser()->tab_strip_model()->GetWebContentsAt(1)->GetMainFrame();
251 frame->ExecuteJavaScript( 251 frame->ExecuteJavaScriptForTests(
252 base::ASCIIToUTF16(base::StringPrintf("Click('%s')", url.c_str()))); 252 base::ASCIIToUTF16(base::StringPrintf("Click('%s')", url.c_str())));
253 } 253 }
254 254
255 void NetInternalsTest::MessageHandler::CreateIncognitoBrowser( 255 void NetInternalsTest::MessageHandler::CreateIncognitoBrowser(
256 const base::ListValue* list_value) { 256 const base::ListValue* list_value) {
257 ASSERT_FALSE(incognito_browser_); 257 ASSERT_FALSE(incognito_browser_);
258 incognito_browser_ = net_internals_test_->CreateIncognitoBrowser(); 258 incognito_browser_ = net_internals_test_->CreateIncognitoBrowser();
259 259
260 // Tell the test harness that creation is complete. 260 // Tell the test harness that creation is complete.
261 base::StringValue command_value("onIncognitoBrowserCreatedForTest"); 261 base::StringValue command_value("onIncognitoBrowserCreatedForTest");
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 if (test_server_started_) 365 if (test_server_started_)
366 return true; 366 return true;
367 test_server_started_ = test_server()->Start(); 367 test_server_started_ = test_server()->Start();
368 368
369 // Sample domain for SDCH-view test. Dictionaries for localhost/127.0.0.1 369 // Sample domain for SDCH-view test. Dictionaries for localhost/127.0.0.1
370 // are forbidden. 370 // are forbidden.
371 host_resolver()->AddRule("testdomain.com", "127.0.0.1"); 371 host_resolver()->AddRule("testdomain.com", "127.0.0.1");
372 host_resolver()->AddRule("sub.testdomain.com", "127.0.0.1"); 372 host_resolver()->AddRule("sub.testdomain.com", "127.0.0.1");
373 return test_server_started_; 373 return test_server_started_;
374 } 374 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc ('k') | chrome/browser/ui/webui/web_ui_test_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698