Chromium Code Reviews| Index: chrome/browser/errorpage_browsertest.cc |
| diff --git a/chrome/browser/errorpage_browsertest.cc b/chrome/browser/errorpage_browsertest.cc |
| index e85d3eb2a88c5615fb4d2f9a782fb867faed159c..177c5904e6e09e58bbd97a87bec5091fff0c137c 100644 |
| --- a/chrome/browser/errorpage_browsertest.cc |
| +++ b/chrome/browser/errorpage_browsertest.cc |
| @@ -131,17 +131,10 @@ void ExpectDisplayingLocalErrorPage(Browser* browser, net::Error error_code) { |
| ToggleHelpBox(browser); |
|
mmenke
2016/02/18 19:51:18
Not needed any more, since the next function doesn
edwardjung
2016/02/19 18:18:21
Done.
|
| // Locally generated error pages should not have navigation corrections. |
| - EXPECT_FALSE(IsDisplayingText(browser, "http://correction1/")); |
| - EXPECT_FALSE(IsDisplayingText(browser, "http://correction2/")); |
| + EXPECT_FALSE(IsDisplayingText(browser, "http://mock.http/title2.html")); |
| - // Locally generated error pages should not have a populated search box. |
| - bool search_box_populated = false; |
| - ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
| - browser->tab_strip_model()->GetActiveWebContents(), |
| - "var searchText = document.getElementById('search-box').value;" |
| - "domAutomationController.send(searchText == 'search query');", |
| - &search_box_populated)); |
| - EXPECT_FALSE(search_box_populated); |
| + // Locally generated error pages should not have a link with search terms. |
| + EXPECT_FALSE(IsDisplayingText(browser, "search query")); |
| } |
| // Checks that an error page with information retrieved from the navigation |
| @@ -151,28 +144,15 @@ void ExpectDisplayingNavigationCorrections(Browser* browser, |
| net::Error error_code) { |
| EXPECT_TRUE(IsDisplayingNetError(browser, error_code)); |
| - // Expand the help box so innerText will include text below the fold. |
| - ToggleHelpBox(browser); |
| - |
| // Check that the mock navigation corrections are displayed. |
| - EXPECT_TRUE(IsDisplayingText(browser, "http://correction1/")); |
| - EXPECT_TRUE(IsDisplayingText(browser, "http://correction2/")); |
| + EXPECT_TRUE(IsDisplayingText(browser, "http://mock.http/title2.html")); |
| - // Check that the search box is populated correctly. |
| - bool search_box_populated = false; |
| - ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
| - browser->tab_strip_model()->GetActiveWebContents(), |
| - "var searchText = document.getElementById('search-box').value;" |
| - "domAutomationController.send(searchText == 'search query');", |
| - &search_box_populated)); |
| - EXPECT_TRUE(search_box_populated); |
| + // Check that the search terms are displayed as a link. |
| + EXPECT_TRUE(IsDisplayingText(browser, "search query")); |
| // The diagnostics button isn't displayed when corrections were |
| // retrieved from a remote server. |
| EXPECT_FALSE(IsDisplayingDiagnosticsButton(browser)); |
| - |
| - // Close help box again, to return page to original state. |
| - ToggleHelpBox(browser); |
| } |
| std::string GetShowSavedButtonLabel() { |
| @@ -673,7 +653,7 @@ IN_PROC_BROWSER_TEST_F(ErrorPageTest, DNSError_GoBack2Forward2) { |
| EXPECT_EQ(3, link_doctor_interceptor()->num_requests()); |
| } |
| -// Test that the search button on a DNS error page works. |
| +// Test that the search link on a DNS error page works. |
| IN_PROC_BROWSER_TEST_F(ErrorPageTest, DNSError_DoSearch) { |
| // The first navigation should fail, and the second one should be the error |
| // page. |
| @@ -694,7 +674,7 @@ IN_PROC_BROWSER_TEST_F(ErrorPageTest, DNSError_DoSearch) { |
| // notification that they've run, and scripts that trigger a navigation may |
| // not send that notification. |
| web_contents->GetMainFrame()->ExecuteJavaScriptForTests( |
| - base::ASCIIToUTF16("document.getElementById('search-button').click();")); |
| + base::ASCIIToUTF16("document.getElementById('search-link').click();")); |
| nav_observer.Wait(); |
| EXPECT_EQ(base::ASCIIToUTF16("Title Of More Awesomeness"), |
| title_watcher.WaitAndGetTitle()); |