OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/stringprintf.h" |
| 6 #include "chrome/browser/extensions/extension_apitest.h" |
| 7 #include "chrome/browser/extensions/extension_webstore_private_api.h" |
| 8 #include "chrome/common/chrome_switches.h" |
| 9 #include "chrome/test/ui_test_utils.h" |
| 10 #include "net/base/mock_host_resolver.h" |
| 11 |
| 12 class ExtensionGalleryInstallApiTest : public ExtensionApiTest { |
| 13 public: |
| 14 void SetUpCommandLine(CommandLine* command_line) { |
| 15 ExtensionApiTest::SetUpCommandLine(command_line); |
| 16 command_line->AppendSwitchASCII(switches::kAppsGalleryURL, |
| 17 "http://www.example.com"); |
| 18 } |
| 19 }; |
| 20 |
| 21 IN_PROC_BROWSER_TEST_F(ExtensionGalleryInstallApiTest, InstallAndUninstall) { |
| 22 host_resolver()->AddRule("www.example.com", "127.0.0.1"); |
| 23 ASSERT_TRUE(test_server()->Start()); |
| 24 |
| 25 std::string base_url = StringPrintf( |
| 26 "http://www.example.com:%u/files/extensions/", |
| 27 test_server()->host_port_pair().port()); |
| 28 |
| 29 std::string testing_install_base_url = base_url; |
| 30 testing_install_base_url += "good.crx"; |
| 31 InstallFunction::SetTestingInstallBaseUrl(testing_install_base_url.c_str()); |
| 32 |
| 33 std::string page_url = base_url; |
| 34 page_url += "api_test/extension_gallery_install/test.html"; |
| 35 ASSERT_TRUE(RunPageTest(page_url.c_str())); |
| 36 } |
OLD | NEW |