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" |
11 | 11 |
12 class ExtensionGalleryInstallApiTest : public ExtensionApiTest { | 12 class ExtensionGalleryInstallApiTest : public ExtensionApiTest { |
13 public: | 13 public: |
14 void SetUpCommandLine(CommandLine* command_line) { | 14 void SetUpCommandLine(CommandLine* command_line) { |
15 ExtensionApiTest::SetUpCommandLine(command_line); | 15 ExtensionApiTest::SetUpCommandLine(command_line); |
16 command_line->AppendSwitchASCII(switches::kAppsGalleryURL, | 16 command_line->AppendSwitchASCII(switches::kAppsGalleryURL, |
17 "http://www.example.com"); | 17 "http://www.example.com"); |
18 } | 18 } |
19 }; | 19 }; |
20 | 20 |
21 // http://crbug.com/55642 - failing on XP. | 21 // http://crbug.com/55642 - failing on XP. |
22 #if defined (OS_WIN) | 22 #if defined (OS_WIN) |
23 #define MAYBE_InstallAndUninstall DISABLED_InstallAndUninstall | 23 #define MAYBE_InstallAndUninstall DISABLED_InstallAndUninstall |
24 #else | 24 #else |
25 #define MAYBE_InstallAndUninstall InstallAndUninstall | 25 #define MAYBE_InstallAndUninstall InstallAndUninstall |
26 #endif | 26 #endif |
27 IN_PROC_BROWSER_TEST_F(ExtensionGalleryInstallApiTest, InstallAndUninstall) { | 27 IN_PROC_BROWSER_TEST_F(ExtensionGalleryInstallApiTest, |
| 28 MAYBE_InstallAndUninstall) { |
28 host_resolver()->AddRule("www.example.com", "127.0.0.1"); | 29 host_resolver()->AddRule("www.example.com", "127.0.0.1"); |
29 ASSERT_TRUE(test_server()->Start()); | 30 ASSERT_TRUE(test_server()->Start()); |
30 | 31 |
31 std::string base_url = base::StringPrintf( | 32 std::string base_url = base::StringPrintf( |
32 "http://www.example.com:%u/files/extensions/", | 33 "http://www.example.com:%u/files/extensions/", |
33 test_server()->host_port_pair().port()); | 34 test_server()->host_port_pair().port()); |
34 | 35 |
35 std::string testing_install_base_url = base_url; | 36 std::string testing_install_base_url = base_url; |
36 testing_install_base_url += "good.crx"; | 37 testing_install_base_url += "good.crx"; |
37 InstallFunction::SetTestingInstallBaseUrl(testing_install_base_url.c_str()); | 38 InstallFunction::SetTestingInstallBaseUrl(testing_install_base_url.c_str()); |
38 | 39 |
39 std::string page_url = base_url; | 40 std::string page_url = base_url; |
40 page_url += "api_test/extension_gallery_install/test.html"; | 41 page_url += "api_test/extension_gallery_install/test.html"; |
41 ASSERT_TRUE(RunPageTest(page_url.c_str())); | 42 ASSERT_TRUE(RunPageTest(page_url.c_str())); |
42 } | 43 } |
OLD | NEW |