diff options
Diffstat (limited to 'chrome/browser/extensions/extension_gallery_install_apitest.cc')
-rw-r--r-- | chrome/browser/extensions/extension_gallery_install_apitest.cc | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/chrome/browser/extensions/extension_gallery_install_apitest.cc b/chrome/browser/extensions/extension_gallery_install_apitest.cc index cf10ed4..820d9ef 100644 --- a/chrome/browser/extensions/extension_gallery_install_apitest.cc +++ b/chrome/browser/extensions/extension_gallery_install_apitest.cc @@ -16,6 +16,22 @@ class ExtensionGalleryInstallApiTest : public ExtensionApiTest { command_line->AppendSwitchASCII(switches::kAppsGalleryURL, "http://www.example.com"); } + + bool RunInstallTest(const std::string& page) { + std::string base_url = base::StringPrintf( + "http://www.example.com:%u/files/extensions/", + test_server()->host_port_pair().port()); + + std::string testing_install_base_url = base_url; + testing_install_base_url += "good.crx"; + CompleteInstallFunction::SetTestingInstallBaseUrl( + testing_install_base_url.c_str()); + + std::string page_url = base_url; + page_url += "api_test/extension_gallery_install/" + page; + + return RunPageTest(page_url.c_str()); + } }; // http://crbug.com/55642 - failing on XP. @@ -29,15 +45,11 @@ IN_PROC_BROWSER_TEST_F(ExtensionGalleryInstallApiTest, host_resolver()->AddRule("www.example.com", "127.0.0.1"); ASSERT_TRUE(test_server()->Start()); - std::string base_url = base::StringPrintf( - "http://www.example.com:%u/files/extensions/", - test_server()->host_port_pair().port()); - - std::string testing_install_base_url = base_url; - testing_install_base_url += "good.crx"; - InstallFunction::SetTestingInstallBaseUrl(testing_install_base_url.c_str()); + BeginInstallFunction::SetIgnoreUserGestureForTests(true); + ASSERT_TRUE(RunInstallTest("test.html")); + ASSERT_TRUE(RunInstallTest("complete_without_begin.html")); + ASSERT_TRUE(RunInstallTest("invalid_begin.html")); - std::string page_url = base_url; - page_url += "api_test/extension_gallery_install/test.html"; - ASSERT_TRUE(RunPageTest(page_url.c_str())); + BeginInstallFunction::SetIgnoreUserGestureForTests(false); + ASSERT_TRUE(RunInstallTest("no_user_gesture.html")); } |