| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/stringprintf.h" | 5 #include "base/stringprintf.h" |
| 6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
| 7 #include "chrome/browser/extensions/extension_webstore_private_api.h" | 7 #include "chrome/browser/extensions/extension_webstore_private_api.h" |
| 8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
| 9 #include "chrome/test/ui_test_utils.h" | 9 #include "chrome/test/ui_test_utils.h" |
| 10 #include "net/base/mock_host_resolver.h" | 10 #include "net/base/mock_host_resolver.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #endif | 26 #endif |
| 27 IN_PROC_BROWSER_TEST_F(ExtensionGalleryInstallApiTest, | 27 IN_PROC_BROWSER_TEST_F(ExtensionGalleryInstallApiTest, |
| 28 MAYBE_InstallAndUninstall) { | 28 MAYBE_InstallAndUninstall) { |
| 29 host_resolver()->AddRule("www.example.com", "127.0.0.1"); | 29 host_resolver()->AddRule("www.example.com", "127.0.0.1"); |
| 30 ASSERT_TRUE(test_server()->Start()); | 30 ASSERT_TRUE(test_server()->Start()); |
| 31 | 31 |
| 32 std::string base_url = base::StringPrintf( | 32 std::string base_url = base::StringPrintf( |
| 33 "http://www.example.com:%u/files/extensions/", | 33 "http://www.example.com:%u/files/extensions/", |
| 34 test_server()->host_port_pair().port()); | 34 test_server()->host_port_pair().port()); |
| 35 | 35 |
| 36 BeginInstallFunction::SetIgnoreUserGestureForTests(true); |
| 36 std::string testing_install_base_url = base_url; | 37 std::string testing_install_base_url = base_url; |
| 37 testing_install_base_url += "good.crx"; | 38 testing_install_base_url += "good.crx"; |
| 38 InstallFunction::SetTestingInstallBaseUrl(testing_install_base_url.c_str()); | 39 CompleteInstallFunction::SetTestingInstallBaseUrl( |
| 40 testing_install_base_url.c_str()); |
| 39 | 41 |
| 40 std::string page_url = base_url; | 42 std::string page_url = base_url; |
| 41 page_url += "api_test/extension_gallery_install/test.html"; | 43 page_url += "api_test/extension_gallery_install/test.html"; |
| 42 ASSERT_TRUE(RunPageTest(page_url.c_str())); | 44 ASSERT_TRUE(RunPageTest(page_url.c_str())); |
| 45 |
| 46 page_url = base_url; |
| 47 page_url += "api_test/extension_gallery_install/test.html?expect_error=true"; |
| 48 BeginInstallFunction::SetIgnoreUserGestureForTests(false); |
| 49 ASSERT_TRUE(RunPageTest(page_url.c_str())); |
| 43 } | 50 } |
| OLD | NEW |