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

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

Issue 518583003: Don't take a fake UGI every time we execute Javascript. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix styling Created 6 years, 3 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 <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 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after
1625 bool new_web_contents) const { 1625 bool new_web_contents) const {
1626 WebContents* web_contents = GetActiveWebContents(); 1626 WebContents* web_contents = GetActiveWebContents();
1627 RenderFrameHost* render_frame_host = web_contents->GetMainFrame(); 1627 RenderFrameHost* render_frame_host = web_contents->GetMainFrame();
1628 // Extra arguments in JS are ignored. 1628 // Extra arguments in JS are ignored.
1629 std::string javascript = base::StringPrintf( 1629 std::string javascript = base::StringPrintf(
1630 "%s('%s', '%s')", javascript_function_name.c_str(), 1630 "%s('%s', '%s')", javascript_function_name.c_str(),
1631 url.spec().c_str(), ping_url.spec().c_str()); 1631 url.spec().c_str(), ping_url.spec().c_str());
1632 1632
1633 if (new_web_contents) { 1633 if (new_web_contents) {
1634 NewTabNavigationOrSwapObserver observer; 1634 NewTabNavigationOrSwapObserver observer;
1635 render_frame_host->ExecuteJavaScript(base::ASCIIToUTF16(javascript)); 1635 render_frame_host->
1636 ExecuteJavaScriptForTests(base::ASCIIToUTF16(javascript));
1636 observer.Wait(); 1637 observer.Wait();
1637 } else { 1638 } else {
1638 NavigationOrSwapObserver observer(current_browser()->tab_strip_model(), 1639 NavigationOrSwapObserver observer(current_browser()->tab_strip_model(),
1639 web_contents); 1640 web_contents);
1640 render_frame_host->ExecuteJavaScript(base::ASCIIToUTF16(javascript)); 1641 render_frame_host->ExecuteJavaScript(base::ASCIIToUTF16(javascript));
1641 observer.Wait(); 1642 observer.Wait();
1642 } 1643 }
1643 } 1644 }
1644 1645
1645 TestPrerenderContentsFactory* prerender_contents_factory_; 1646 TestPrerenderContentsFactory* prerender_contents_factory_;
(...skipping 2770 matching lines...) Expand 10 before | Expand all | Expand 10 after
4416 4417
4417 // Navigate to the URL entered. 4418 // Navigate to the URL entered.
4418 omnibox_view->model()->AcceptInput(CURRENT_TAB, false); 4419 omnibox_view->model()->AcceptInput(CURRENT_TAB, false);
4419 4420
4420 // Prerender should be running, but abandoned. 4421 // Prerender should be running, but abandoned.
4421 EXPECT_TRUE( 4422 EXPECT_TRUE(
4422 GetAutocompleteActionPredictor()->IsPrerenderAbandonedForTesting()); 4423 GetAutocompleteActionPredictor()->IsPrerenderAbandonedForTesting());
4423 } 4424 }
4424 4425
4425 } // namespace prerender 4426 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/extensions/webstore_installer_test.cc ('k') | chrome/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698