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

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

Issue 12089051: Revert 179271 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "base/values.h" 12 #include "base/values.h"
13 #include "chrome/browser/prerender/prerender_manager.h" 13 #include "chrome/browser/prerender/prerender_manager.h"
14 #include "chrome/browser/prerender/prerender_manager_factory.h" 14 #include "chrome/browser/prerender/prerender_manager_factory.h"
15 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/ui/browser.h" 16 #include "chrome/browser/ui/browser.h"
17 #include "chrome/browser/ui/tabs/tab_strip_model.h" 17 #include "chrome/browser/ui/tabs/tab_strip_model.h"
18 #include "chrome/browser/ui/webui/web_ui_browsertest.h"
18 #include "chrome/common/chrome_switches.h" 19 #include "chrome/common/chrome_switches.h"
19 #include "chrome/test/base/ui_test_utils.h" 20 #include "chrome/test/base/ui_test_utils.h"
20 #include "content/public/browser/render_view_host.h" 21 #include "content/public/browser/render_view_host.h"
21 #include "content/public/browser/web_contents.h" 22 #include "content/public/browser/web_contents.h"
22 #include "content/public/browser/web_ui_message_handler.h" 23 #include "content/public/browser/web_ui_message_handler.h"
23 #include "googleurl/src/gurl.h" 24 #include "googleurl/src/gurl.h"
24 #include "net/base/address_list.h" 25 #include "net/base/address_list.h"
25 #include "net/base/host_cache.h" 26 #include "net/base/host_cache.h"
26 #include "net/base/host_resolver.h" 27 #include "net/base/host_resolver.h"
27 #include "net/base/host_resolver_proc.h" 28 #include "net/base/host_resolver_proc.h"
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 } 338 }
338 339
339 void NetInternalsTest::SetUpCommandLine(CommandLine* command_line) { 340 void NetInternalsTest::SetUpCommandLine(CommandLine* command_line) {
340 WebUIBrowserTest::SetUpCommandLine(command_line); 341 WebUIBrowserTest::SetUpCommandLine(command_line);
341 // Needed to test the prerender view. 342 // Needed to test the prerender view.
342 command_line->AppendSwitchASCII(switches::kPrerenderMode, 343 command_line->AppendSwitchASCII(switches::kPrerenderMode,
343 switches::kPrerenderModeSwitchValueEnabled); 344 switches::kPrerenderModeSwitchValueEnabled);
344 } 345 }
345 346
346 void NetInternalsTest::SetUpOnMainThread() { 347 void NetInternalsTest::SetUpOnMainThread() {
347 WebUIBrowserTest::SetUpOnMainThread();
348 // Increase the memory allowed in a prerendered page above normal settings, 348 // Increase the memory allowed in a prerendered page above normal settings,
349 // as debug builds use more memory and often go over the usual limit. 349 // as debug builds use more memory and often go over the usual limit.
350 Profile* profile = browser()->profile(); 350 Profile* profile = browser()->profile();
351 prerender::PrerenderManager* prerender_manager = 351 prerender::PrerenderManager* prerender_manager =
352 prerender::PrerenderManagerFactory::GetForProfile(profile); 352 prerender::PrerenderManagerFactory::GetForProfile(profile);
353 prerender_manager->mutable_config().max_bytes = 1000 * 1024 * 1024; 353 prerender_manager->mutable_config().max_bytes = 1000 * 1024 * 1024;
354 } 354 }
355 355
356 content::WebUIMessageHandler* NetInternalsTest::GetMockMessageHandler() { 356 content::WebUIMessageHandler* NetInternalsTest::GetMockMessageHandler() {
357 return message_handler_.get(); 357 return message_handler_.get();
(...skipping 15 matching lines...) Expand all
373 GURL url_loader = test_server()->GetURL(replacement_path); 373 GURL url_loader = test_server()->GetURL(replacement_path);
374 return url_loader; 374 return url_loader;
375 } 375 }
376 376
377 bool NetInternalsTest::StartTestServer() { 377 bool NetInternalsTest::StartTestServer() {
378 if (test_server_started_) 378 if (test_server_started_)
379 return true; 379 return true;
380 test_server_started_ = test_server()->Start(); 380 test_server_started_ = test_server()->Start();
381 return test_server_started_; 381 return test_server_started_;
382 } 382 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698