Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(922)

Unified Diff: chrome/browser/errorpage_browsertest.cc

Issue 1639953002: Network error interstitial update - add suggestions list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix browser and unit tests Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/errorpage_browsertest.cc
diff --git a/chrome/browser/errorpage_browsertest.cc b/chrome/browser/errorpage_browsertest.cc
index 5104bef53520d747b0ba5ef54722997e86aa7c19..aed026a517676c86a5976ee74f55a9b92c17564c 100644
--- a/chrome/browser/errorpage_browsertest.cc
+++ b/chrome/browser/errorpage_browsertest.cc
@@ -126,21 +126,11 @@ bool WARN_UNUSED_RESULT IsDisplayingDiagnosticsButton(Browser* browser) {
void ExpectDisplayingLocalErrorPage(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);
-
// 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
@@ -150,28 +140,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() {
@@ -672,7 +649,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.
@@ -693,7 +670,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());
« no previous file with comments | « no previous file | chrome/browser/net/dns_probe_browsertest.cc » ('j') | chrome/browser/net/dns_probe_browsertest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698