| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |