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

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

Issue 2851103002: Update some host_resolver()->AddRules in chrome/browser. (Closed)
Patch Set: fix Created 3 years, 7 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
« no previous file with comments | « chrome/browser/ui/views/accessibility/navigation_accessibility_uitest_win.cc ('k') | no next file » | 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 "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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 WebUIBrowserTest::SetUpOnMainThread(); 349 WebUIBrowserTest::SetUpOnMainThread();
350 // Needed to test the prerender view. 350 // Needed to test the prerender view.
351 prerender::PrerenderManager::SetMode( 351 prerender::PrerenderManager::SetMode(
352 prerender::PrerenderManager::PRERENDER_MODE_ENABLED); 352 prerender::PrerenderManager::PRERENDER_MODE_ENABLED);
353 // Increase the memory allowed in a prerendered page above normal settings, 353 // Increase the memory allowed in a prerendered page above normal settings,
354 // as debug builds use more memory and often go over the usual limit. 354 // as debug builds use more memory and often go over the usual limit.
355 Profile* profile = browser()->profile(); 355 Profile* profile = browser()->profile();
356 prerender::PrerenderManager* prerender_manager = 356 prerender::PrerenderManager* prerender_manager =
357 prerender::PrerenderManagerFactory::GetForBrowserContext(profile); 357 prerender::PrerenderManagerFactory::GetForBrowserContext(profile);
358 prerender_manager->mutable_config().max_bytes = 1000 * 1024 * 1024; 358 prerender_manager->mutable_config().max_bytes = 1000 * 1024 * 1024;
359
360 // Sample domain for SDCH-view test. Dictionaries for localhost/127.0.0.1
361 // are forbidden.
362 host_resolver()->AddRule("testdomain.com", "127.0.0.1");
363 host_resolver()->AddRule("sub.testdomain.com", "127.0.0.1");
359 } 364 }
360 365
361 content::WebUIMessageHandler* NetInternalsTest::GetMockMessageHandler() { 366 content::WebUIMessageHandler* NetInternalsTest::GetMockMessageHandler() {
362 return message_handler_.get(); 367 return message_handler_.get();
363 } 368 }
364 369
365 GURL NetInternalsTest::CreatePrerenderLoaderUrl( 370 GURL NetInternalsTest::CreatePrerenderLoaderUrl(
366 const GURL& prerender_url) { 371 const GURL& prerender_url) {
367 EXPECT_TRUE(StartTestServer()); 372 EXPECT_TRUE(StartTestServer());
368 base::StringPairs replacement_text; 373 base::StringPairs replacement_text;
369 replacement_text.push_back( 374 replacement_text.push_back(
370 make_pair("REPLACE_WITH_PRERENDER_URL", prerender_url.spec())); 375 make_pair("REPLACE_WITH_PRERENDER_URL", prerender_url.spec()));
371 std::string replacement_path; 376 std::string replacement_path;
372 net::test_server::GetFilePathWithReplacements( 377 net::test_server::GetFilePathWithReplacements(
373 "/prerender/prerender_loader.html", replacement_text, &replacement_path); 378 "/prerender/prerender_loader.html", replacement_text, &replacement_path);
374 GURL url_loader = embedded_test_server()->GetURL(replacement_path); 379 GURL url_loader = embedded_test_server()->GetURL(replacement_path);
375 return url_loader; 380 return url_loader;
376 } 381 }
377 382
378 bool NetInternalsTest::StartTestServer() { 383 bool NetInternalsTest::StartTestServer() {
379 if (test_server_started_) 384 if (test_server_started_)
380 return true; 385 return true;
381 test_server_started_ = embedded_test_server()->Start(); 386 test_server_started_ = embedded_test_server()->Start();
382 387
383 // Sample domain for SDCH-view test. Dictionaries for localhost/127.0.0.1
384 // are forbidden.
385 host_resolver()->AddRule("testdomain.com", "127.0.0.1");
386 host_resolver()->AddRule("sub.testdomain.com", "127.0.0.1");
387 return test_server_started_; 388 return test_server_started_;
388 } 389 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/accessibility/navigation_accessibility_uitest_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698