OLD | NEW |
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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 ExecuteJavaScriptForTests(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. | |
139 // See crbug.com/357774. | |
140 ExtensionInstallPrompt::g_auto_confirm_for_tests = | 138 ExtensionInstallPrompt::g_auto_confirm_for_tests = |
141 ExtensionInstallPrompt::ACCEPT; | 139 ExtensionInstallPrompt::ACCEPT; |
142 } | 140 } |
143 | 141 |
144 void WebstoreInstallerTest::AutoCancelInstall() { | 142 void WebstoreInstallerTest::AutoCancelInstall() { |
145 ExtensionInstallPrompt::g_auto_confirm_for_tests = | 143 ExtensionInstallPrompt::g_auto_confirm_for_tests = |
146 ExtensionInstallPrompt::CANCEL; | 144 ExtensionInstallPrompt::CANCEL; |
147 } | 145 } |
OLD | NEW |