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

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

Issue 9623018: Prerendered pages are swapped in at browser::Navigate time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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_path.h" 10 #include "base/file_path.h"
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 content::WebUIMessageHandler* NetInternalsTest::GetMockMessageHandler() { 333 content::WebUIMessageHandler* NetInternalsTest::GetMockMessageHandler() {
334 return message_handler_.get(); 334 return message_handler_.get();
335 } 335 }
336 336
337 GURL NetInternalsTest::CreatePrerenderLoaderUrl( 337 GURL NetInternalsTest::CreatePrerenderLoaderUrl(
338 const GURL& prerender_url) { 338 const GURL& prerender_url) {
339 EXPECT_TRUE(StartTestServer()); 339 EXPECT_TRUE(StartTestServer());
340 std::vector<net::TestServer::StringPair> replacement_text; 340 std::vector<net::TestServer::StringPair> replacement_text;
341 replacement_text.push_back( 341 replacement_text.push_back(
342 make_pair("REPLACE_WITH_PRERENDER_URL", prerender_url.spec())); 342 make_pair("REPLACE_WITH_PRERENDER_URL", prerender_url.spec()));
343 replacement_text.push_back(
344 make_pair("REPLACE_WITH_DESTINATION_URL", prerender_url.spec()));
343 std::string replacement_path; 345 std::string replacement_path;
344 EXPECT_TRUE(net::TestServer::GetFilePathWithReplacements( 346 EXPECT_TRUE(net::TestServer::GetFilePathWithReplacements(
345 "files/prerender/prerender_loader.html", 347 "files/prerender/prerender_loader.html",
346 replacement_text, 348 replacement_text,
347 &replacement_path)); 349 &replacement_path));
348 GURL url_loader = test_server()->GetURL(replacement_path); 350 GURL url_loader = test_server()->GetURL(replacement_path);
349 return url_loader; 351 return url_loader;
350 } 352 }
351 353
352 bool NetInternalsTest::StartTestServer() { 354 bool NetInternalsTest::StartTestServer() {
353 if (test_server_started_) 355 if (test_server_started_)
354 return true; 356 return true;
355 test_server_started_ = test_server()->Start(); 357 test_server_started_ = test_server()->Start();
356 return test_server_started_; 358 return test_server_started_;
357 } 359 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698