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

Side by Side Diff: chrome/browser/net/dns_probe_browsertest.cc

Issue 1639953002: Network error interstitial update - add suggestions list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove view policies suggestion Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <set> 5 #include <set>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 "domAutomationController.send(document.body.textContent);", 643 "domAutomationController.send(document.body.textContent);",
644 &text_content); 644 &text_content);
645 if (!rv) 645 if (!rv)
646 return false; 646 return false;
647 647
648 return text_content.find(expected) != std::string::npos; 648 return text_content.find(expected) != std::string::npos;
649 } 649 }
650 650
651 void DnsProbeBrowserTest::ExpectDisplayingLocalErrorPage( 651 void DnsProbeBrowserTest::ExpectDisplayingLocalErrorPage(
652 const std::string& status_text) { 652 const std::string& status_text) {
653 EXPECT_FALSE(PageContains("http://correction1/")); 653 EXPECT_FALSE(PageContains("http://mock.http/title2.html"));
654 EXPECT_FALSE(PageContains("http://correction2/"));
655 EXPECT_TRUE(PageContains(status_text)); 654 EXPECT_TRUE(PageContains(status_text));
656 } 655 }
657 656
658 void DnsProbeBrowserTest::ExpectDisplayingCorrections( 657 void DnsProbeBrowserTest::ExpectDisplayingCorrections(
659 const std::string& status_text) { 658 const std::string& status_text) {
660 EXPECT_TRUE(PageContains("http://correction1/")); 659 EXPECT_TRUE(PageContains("http://mock.http/title2.html"));
661 EXPECT_TRUE(PageContains("http://correction2/"));
662 EXPECT_TRUE(PageContains(status_text)); 660 EXPECT_TRUE(PageContains(status_text));
663 } 661 }
664 662
665 void DnsProbeBrowserTest::OnDnsProbeStatusSent( 663 void DnsProbeBrowserTest::OnDnsProbeStatusSent(
666 DnsProbeStatus dns_probe_status) { 664 DnsProbeStatus dns_probe_status) {
667 dns_probe_status_queue_.push_back(dns_probe_status); 665 dns_probe_status_queue_.push_back(dns_probe_status);
668 if (awaiting_dns_probe_status_) 666 if (awaiting_dns_probe_status_)
669 MessageLoop::current()->QuitWhenIdle(); 667 MessageLoop::current()->QuitWhenIdle();
670 } 668 }
671 669
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 983
986 EXPECT_EQ(error_page::DNS_PROBE_FINISHED_INCONCLUSIVE, 984 EXPECT_EQ(error_page::DNS_PROBE_FINISHED_INCONCLUSIVE,
987 WaitForSentStatus()); 985 WaitForSentStatus());
988 EXPECT_EQ(0, pending_status_count()); 986 EXPECT_EQ(0, pending_status_count());
989 ExpectDisplayingLocalErrorPage("ERR_NAME_NOT_RESOLVED"); 987 ExpectDisplayingLocalErrorPage("ERR_NAME_NOT_RESOLVED");
990 } 988 }
991 989
992 } // namespace 990 } // namespace
993 991
994 } // namespace chrome_browser_net 992 } // namespace chrome_browser_net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698