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

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

Issue 442303002: DevTools: migrate DevTools APIs to use WebContents instead of RenderViewHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for landing Created 6 years, 4 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 <deque> 5 #include <deque>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 3277 matching lines...) Expand 10 before | Expand all | Expand 10 after
3288 ASSERT_TRUE(prerender->contents()); 3288 ASSERT_TRUE(prerender->contents());
3289 prerender->contents()->set_should_be_shown(false); 3289 prerender->contents()->set_should_be_shown(false);
3290 OpenDestURLViaClickNewBackgroundTab(); 3290 OpenDestURLViaClickNewBackgroundTab();
3291 } 3291 }
3292 3292
3293 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, 3293 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
3294 NavigateToPrerenderedPageWhenDevToolsAttached) { 3294 NavigateToPrerenderedPageWhenDevToolsAttached) {
3295 DisableJavascriptCalls(); 3295 DisableJavascriptCalls();
3296 WebContents* web_contents = 3296 WebContents* web_contents =
3297 current_browser()->tab_strip_model()->GetActiveWebContents(); 3297 current_browser()->tab_strip_model()->GetActiveWebContents();
3298 scoped_refptr<DevToolsAgentHost> agent(DevToolsAgentHost::GetOrCreateFor( 3298 scoped_refptr<DevToolsAgentHost> agent(
3299 web_contents->GetRenderViewHost())); 3299 DevToolsAgentHost::GetOrCreateFor(web_contents));
3300 DevToolsManager* manager = DevToolsManager::GetInstance(); 3300 DevToolsManager* manager = DevToolsManager::GetInstance();
3301 FakeDevToolsClientHost client_host; 3301 FakeDevToolsClientHost client_host;
3302 manager->RegisterDevToolsClientHostFor(agent.get(), &client_host); 3302 manager->RegisterDevToolsClientHostFor(agent.get(), &client_host);
3303 const char* url = "files/prerender/prerender_page.html"; 3303 const char* url = "files/prerender/prerender_page.html";
3304 PrerenderTestURL(url, FINAL_STATUS_DEVTOOLS_ATTACHED, 1); 3304 PrerenderTestURL(url, FINAL_STATUS_DEVTOOLS_ATTACHED, 1);
3305 NavigateToURLWithDisposition(url, CURRENT_TAB, false); 3305 NavigateToURLWithDisposition(url, CURRENT_TAB, false);
3306 manager->ClientHostClosing(&client_host); 3306 manager->ClientHostClosing(&client_host);
3307 } 3307 }
3308 3308
3309 // Validate that the sessionStorage namespace remains the same when swapping 3309 // Validate that the sessionStorage namespace remains the same when swapping
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after
4419 4419
4420 // Navigate to the URL entered. 4420 // Navigate to the URL entered.
4421 omnibox_view->model()->AcceptInput(CURRENT_TAB, false); 4421 omnibox_view->model()->AcceptInput(CURRENT_TAB, false);
4422 4422
4423 // Prerender should be running, but abandoned. 4423 // Prerender should be running, but abandoned.
4424 EXPECT_TRUE( 4424 EXPECT_TRUE(
4425 GetAutocompleteActionPredictor()->IsPrerenderAbandonedForTesting()); 4425 GetAutocompleteActionPredictor()->IsPrerenderAbandonedForTesting());
4426 } 4426 }
4427 4427
4428 } // namespace prerender 4428 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/printing/print_dialog_cloud.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698