Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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")); |
|
edwardjung
2016/02/25 19:00:03
Changed URLs as showing only the first URL suggest
| |
| 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 Loading... | |
| 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 |
| OLD | NEW |