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

Side by Side Diff: chrome/browser/extensions/webstore_installer_test.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/strings/stringprintf.h" 6 #include "base/strings/stringprintf.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/download/download_prefs.h" 8 #include "chrome/browser/download/download_prefs.h"
9 #include "chrome/browser/extensions/extension_install_prompt.h" 9 #include "chrome/browser/extensions/extension_install_prompt.h"
10 #include "chrome/browser/extensions/tab_helper.h" 10 #include "chrome/browser/extensions/tab_helper.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 &result)); 124 &result));
125 EXPECT_TRUE(result != "FAILED"); 125 EXPECT_TRUE(result != "FAILED");
126 return result == "KEEPGOING"; 126 return result == "KEEPGOING";
127 } 127 }
128 128
129 void WebstoreInstallerTest::RunTestAsync( 129 void WebstoreInstallerTest::RunTestAsync(
130 const std::string& test_function_name) { 130 const std::string& test_function_name) {
131 std::string script = base::StringPrintf( 131 std::string script = base::StringPrintf(
132 "%s('%s')", test_function_name.c_str(), test_gallery_url_.c_str()); 132 "%s('%s')", test_function_name.c_str(), test_gallery_url_.c_str());
133 browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame()-> 133 browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame()->
134 ExecuteJavaScript(base::UTF8ToUTF16(script)); 134 ExecuteJavaScriptForTests(base::UTF8ToUTF16(script));
135 } 135 }
136 136
137 void WebstoreInstallerTest::AutoAcceptInstall() { 137 void WebstoreInstallerTest::AutoAcceptInstall() {
138 // TODO(tmdiep): Refactor and remove the use of the command line flag. 138 // TODO(tmdiep): Refactor and remove the use of the command line flag.
139 // See crbug.com/357774. 139 // See crbug.com/357774.
140 ExtensionInstallPrompt::g_auto_confirm_for_tests = 140 ExtensionInstallPrompt::g_auto_confirm_for_tests =
141 ExtensionInstallPrompt::ACCEPT; 141 ExtensionInstallPrompt::ACCEPT;
142 } 142 }
143 143
144 void WebstoreInstallerTest::AutoCancelInstall() { 144 void WebstoreInstallerTest::AutoCancelInstall() {
145 ExtensionInstallPrompt::g_auto_confirm_for_tests = 145 ExtensionInstallPrompt::g_auto_confirm_for_tests =
146 ExtensionInstallPrompt::CANCEL; 146 ExtensionInstallPrompt::CANCEL;
147 } 147 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_messages_apitest.cc ('k') | chrome/browser/prerender/prerender_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698