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

Side by Side Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 2754003006: Prerender: omnibox and instant field trial parameters. (Closed)
Patch Set: browsertest tweaks Created 3 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
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 <stddef.h> 5 #include <stddef.h>
6 #include <deque> 6 #include <deque>
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <unordered_map> 9 #include <unordered_map>
10 #include <utility> 10 #include <utility>
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 480
481 class FakeDevToolsClient : public content::DevToolsAgentHostClient { 481 class FakeDevToolsClient : public content::DevToolsAgentHostClient {
482 public: 482 public:
483 FakeDevToolsClient() {} 483 FakeDevToolsClient() {}
484 ~FakeDevToolsClient() override {} 484 ~FakeDevToolsClient() override {}
485 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, 485 void DispatchProtocolMessage(DevToolsAgentHost* agent_host,
486 const std::string& message) override {} 486 const std::string& message) override {}
487 void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override {} 487 void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override {}
488 }; 488 };
489 489
490 class RestorePrerenderMode {
491 public:
492 RestorePrerenderMode() : prev_mode_(PrerenderManager::GetMode()) {
493 }
494
495 ~RestorePrerenderMode() { PrerenderManager::SetMode(prev_mode_); }
496 private:
497 PrerenderManager::PrerenderManagerMode prev_mode_;
498 };
499
500 // A ContentBrowserClient that cancels all prerenderers on OpenURL. 490 // A ContentBrowserClient that cancels all prerenderers on OpenURL.
501 class TestContentBrowserClient : public ChromeContentBrowserClient { 491 class TestContentBrowserClient : public ChromeContentBrowserClient {
502 public: 492 public:
503 TestContentBrowserClient() {} 493 TestContentBrowserClient() {}
504 ~TestContentBrowserClient() override {} 494 ~TestContentBrowserClient() override {}
505 495
506 // ChromeContentBrowserClient: 496 // ChromeContentBrowserClient:
507 bool ShouldAllowOpenURL(content::SiteInstance* site_instance, 497 bool ShouldAllowOpenURL(content::SiteInstance* site_instance,
508 const GURL& url) override { 498 const GURL& url) override {
509 PrerenderManagerFactory::GetForBrowserContext( 499 PrerenderManagerFactory::GetForBrowserContext(
(...skipping 3304 matching lines...) Expand 10 before | Expand all | Expand 10 after
3814 browser()->tab_strip_model()->GetActiveWebContents(); 3804 browser()->tab_strip_model()->GetActiveWebContents();
3815 bool display_test_result = false; 3805 bool display_test_result = false;
3816 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, 3806 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents,
3817 "DidDisplayReallyPass()", 3807 "DidDisplayReallyPass()",
3818 &display_test_result)); 3808 &display_test_result));
3819 ASSERT_TRUE(display_test_result); 3809 ASSERT_TRUE(display_test_result);
3820 } 3810 }
3821 #endif // !defined(DISABLE_NACL) 3811 #endif // !defined(DISABLE_NACL)
3822 3812
3823 } // namespace prerender 3813 } // namespace prerender
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_field_trial.h » ('j') | chrome/browser/prerender/prerender_field_trial.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698