| Index: chrome/renderer/external_extension_uitest.cc
|
| diff --git a/chrome/renderer/external_extension_uitest.cc b/chrome/renderer/external_extension_uitest.cc
|
| index 427ec16e96b8679555c174c76346b7019ebaa45f..a5d847513b714a7b23b0a51c121581849dde9cb2 100644
|
| --- a/chrome/renderer/external_extension_uitest.cc
|
| +++ b/chrome/renderer/external_extension_uitest.cc
|
| @@ -28,6 +28,7 @@ class SearchProviderTest : public UITest {
|
| const IsSearchProviderTestData& data);
|
|
|
| net::TestServer test_server_;
|
| + GURL search_provider_test_url_;
|
| bool test_server_started_;
|
|
|
| private:
|
| @@ -50,6 +51,10 @@ SearchProviderTest::SearchProviderTest()
|
| // Map all hosts to our local server.
|
| std::string host_rule("MAP * " + test_server_.host_port_pair().ToString());
|
| launch_arguments_.AppendSwitchASCII(switches::kHostRules, host_rule);
|
| +
|
| + // Get the url for the test page.
|
| + search_provider_test_url_ =
|
| + test_server_.GetURL("files/is_search_provider_installed.html");
|
| }
|
|
|
| struct IsSearchProviderTestData {
|
| @@ -93,10 +98,8 @@ IsSearchProviderTestData SearchProviderTest::StartIsSearchProviderInstalledTest(
|
| }
|
|
|
| // Go to the test page.
|
| - GURL local_url =
|
| - test_server_.GetURL("files/is_search_provider_installed.html");
|
| - GURL test_url(std::string("http://") + host + local_url.path() +
|
| - "#" + expected_result);
|
| + GURL test_url(std::string("http://") + host +
|
| + search_provider_test_url_.path() + "#" + expected_result);
|
| EXPECT_TRUE(tab->NavigateToURLAsync(test_url));
|
|
|
| // Bundle up information needed to verify the result.
|
| @@ -122,6 +125,7 @@ void SearchProviderTest::FinishIsSearchProviderInstalledTest(
|
| value += "\n";
|
| ReplaceSubstringsAfterOffset(&value, 0, "\r", "");
|
| EXPECT_STREQ("1\n", value.c_str());
|
| + EXPECT_TRUE(data.tab->Close(true));
|
| }
|
|
|
| // http://code.google.com/p/chromium/issues/detail?id=62777
|
| @@ -173,3 +177,14 @@ TEST_F(SearchProviderTest, FLAKY_TestIsSearchProviderInstalled) {
|
| }
|
| #endif
|
| }
|
| +
|
| +TEST_F(SearchProviderTest, TestIsSearchProviderInstalledWithException) {
|
| + // Change the url for the test page to one that throws an exception when
|
| + // toString is called on the argument given to isSearchProviderInstalled.
|
| + search_provider_test_url_ = test_server_.GetURL(
|
| + "files/is_search_provider_installed_with_exception.html");
|
| +
|
| + scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
|
| + FinishIsSearchProviderInstalledTest(StartIsSearchProviderInstalledTest(
|
| + browser, "www.google.com", ""));
|
| +}
|
|
|