| 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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 | 422 |
| 423 delaying_dns_probe_service_->StartDelayedProbes(); | 423 delaying_dns_probe_service_->StartDelayedProbes(); |
| 424 } | 424 } |
| 425 | 425 |
| 426 class DnsProbeBrowserTest : public InProcessBrowserTest { | 426 class DnsProbeBrowserTest : public InProcessBrowserTest { |
| 427 public: | 427 public: |
| 428 DnsProbeBrowserTest(); | 428 DnsProbeBrowserTest(); |
| 429 virtual ~DnsProbeBrowserTest(); | 429 virtual ~DnsProbeBrowserTest(); |
| 430 | 430 |
| 431 virtual void SetUpOnMainThread() OVERRIDE; | 431 virtual void SetUpOnMainThread() OVERRIDE; |
| 432 virtual void CleanUpOnMainThread() OVERRIDE; | 432 virtual void TearDownOnMainThread() OVERRIDE; |
| 433 | 433 |
| 434 protected: | 434 protected: |
| 435 // Sets the browser object that other methods apply to, and that has the | 435 // Sets the browser object that other methods apply to, and that has the |
| 436 // DnsProbeStatus messages of its currently active tab monitored. | 436 // DnsProbeStatus messages of its currently active tab monitored. |
| 437 void SetActiveBrowser(Browser* browser); | 437 void SetActiveBrowser(Browser* browser); |
| 438 | 438 |
| 439 void SetCorrectionServiceBroken(bool broken); | 439 void SetCorrectionServiceBroken(bool broken); |
| 440 void SetCorrectionServiceDelayRequests(bool delay_requests); | 440 void SetCorrectionServiceDelayRequests(bool delay_requests); |
| 441 void WaitForDelayedRequestDestruction(); | 441 void WaitForDelayedRequestDestruction(); |
| 442 void SetMockDnsClientRules(MockDnsClientRule::Result system_result, | 442 void SetMockDnsClientRules(MockDnsClientRule::Result system_result, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 | 502 |
| 503 BrowserThread::PostTask( | 503 BrowserThread::PostTask( |
| 504 BrowserThread::IO, FROM_HERE, | 504 BrowserThread::IO, FROM_HERE, |
| 505 Bind(&DnsProbeBrowserTestIOThreadHelper::SetUpOnIOThread, | 505 Bind(&DnsProbeBrowserTestIOThreadHelper::SetUpOnIOThread, |
| 506 Unretained(helper_), | 506 Unretained(helper_), |
| 507 g_browser_process->io_thread())); | 507 g_browser_process->io_thread())); |
| 508 | 508 |
| 509 SetActiveBrowser(browser()); | 509 SetActiveBrowser(browser()); |
| 510 } | 510 } |
| 511 | 511 |
| 512 void DnsProbeBrowserTest::CleanUpOnMainThread() { | 512 void DnsProbeBrowserTest::TearDownOnMainThread() { |
| 513 BrowserThread::PostTask( | 513 BrowserThread::PostTask( |
| 514 BrowserThread::IO, FROM_HERE, | 514 BrowserThread::IO, FROM_HERE, |
| 515 Bind(&DnsProbeBrowserTestIOThreadHelper::CleanUpOnIOThreadAndDeleteHelper, | 515 Bind(&DnsProbeBrowserTestIOThreadHelper::CleanUpOnIOThreadAndDeleteHelper, |
| 516 Unretained(helper_))); | 516 Unretained(helper_))); |
| 517 | 517 |
| 518 NetErrorTabHelper::set_state_for_testing( | 518 NetErrorTabHelper::set_state_for_testing( |
| 519 NetErrorTabHelper::TESTING_DEFAULT); | 519 NetErrorTabHelper::TESTING_DEFAULT); |
| 520 } | 520 } |
| 521 | 521 |
| 522 void DnsProbeBrowserTest::SetActiveBrowser(Browser* browser) { | 522 void DnsProbeBrowserTest::SetActiveBrowser(Browser* browser) { |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 | 986 |
| 987 EXPECT_EQ(chrome_common_net::DNS_PROBE_FINISHED_INCONCLUSIVE, | 987 EXPECT_EQ(chrome_common_net::DNS_PROBE_FINISHED_INCONCLUSIVE, |
| 988 WaitForSentStatus()); | 988 WaitForSentStatus()); |
| 989 EXPECT_EQ(0, pending_status_count()); | 989 EXPECT_EQ(0, pending_status_count()); |
| 990 ExpectDisplayingLocalErrorPage("ERR_NAME_NOT_RESOLVED"); | 990 ExpectDisplayingLocalErrorPage("ERR_NAME_NOT_RESOLVED"); |
| 991 } | 991 } |
| 992 | 992 |
| 993 } // namespace | 993 } // namespace |
| 994 | 994 |
| 995 } // namespace chrome_browser_net | 995 } // namespace chrome_browser_net |
| OLD | NEW |