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

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

Issue 136583007: Refactor prerender_browsertests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 "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/file_util.h" 10 #include "base/file_util.h"
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 content::WebUIMessageHandler* NetInternalsTest::GetMockMessageHandler() { 410 content::WebUIMessageHandler* NetInternalsTest::GetMockMessageHandler() {
411 return message_handler_.get(); 411 return message_handler_.get();
412 } 412 }
413 413
414 GURL NetInternalsTest::CreatePrerenderLoaderUrl( 414 GURL NetInternalsTest::CreatePrerenderLoaderUrl(
415 const GURL& prerender_url) { 415 const GURL& prerender_url) {
416 EXPECT_TRUE(StartTestServer()); 416 EXPECT_TRUE(StartTestServer());
417 std::vector<net::SpawnedTestServer::StringPair> replacement_text; 417 std::vector<net::SpawnedTestServer::StringPair> replacement_text;
418 replacement_text.push_back( 418 replacement_text.push_back(
419 make_pair("REPLACE_WITH_PRERENDER_URL", prerender_url.spec())); 419 make_pair("REPLACE_WITH_PRERENDER_URL", prerender_url.spec()));
420 replacement_text.push_back(
421 make_pair("REPLACE_WITH_DESTINATION_URL", prerender_url.spec()));
422 std::string replacement_path; 420 std::string replacement_path;
423 EXPECT_TRUE(net::SpawnedTestServer::GetFilePathWithReplacements( 421 EXPECT_TRUE(net::SpawnedTestServer::GetFilePathWithReplacements(
424 "files/prerender/prerender_loader.html", 422 "files/prerender/prerender_loader.html",
425 replacement_text, 423 replacement_text,
426 &replacement_path)); 424 &replacement_path));
427 GURL url_loader = test_server()->GetURL(replacement_path); 425 GURL url_loader = test_server()->GetURL(replacement_path);
428 return url_loader; 426 return url_loader;
429 } 427 }
430 428
431 bool NetInternalsTest::StartTestServer() { 429 bool NetInternalsTest::StartTestServer() {
432 if (test_server_started_) 430 if (test_server_started_)
433 return true; 431 return true;
434 test_server_started_ = test_server()->Start(); 432 test_server_started_ = test_server()->Start();
435 return test_server_started_; 433 return test_server_started_;
436 } 434 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698