| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/dns/host_resolver_impl.h" | 5 #include "net/dns/host_resolver_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 2389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2400 proc_->SignalMultiple(3u); | 2400 proc_->SignalMultiple(3u); |
| 2401 | 2401 |
| 2402 EXPECT_THAT(requests_[0]->WaitForResult(), IsOk()); | 2402 EXPECT_THAT(requests_[0]->WaitForResult(), IsOk()); |
| 2403 EXPECT_TRUE(requests_[0]->HasOneAddress("192.168.0.1", 80)); | 2403 EXPECT_TRUE(requests_[0]->HasOneAddress("192.168.0.1", 80)); |
| 2404 EXPECT_THAT(requests_[1]->WaitForResult(), IsOk()); | 2404 EXPECT_THAT(requests_[1]->WaitForResult(), IsOk()); |
| 2405 EXPECT_TRUE(requests_[1]->HasOneAddress("192.168.0.2", 80)); | 2405 EXPECT_TRUE(requests_[1]->HasOneAddress("192.168.0.2", 80)); |
| 2406 EXPECT_THAT(requests_[2]->WaitForResult(), IsOk()); | 2406 EXPECT_THAT(requests_[2]->WaitForResult(), IsOk()); |
| 2407 EXPECT_TRUE(requests_[2]->HasOneAddress("192.168.0.3", 80)); | 2407 EXPECT_TRUE(requests_[2]->HasOneAddress("192.168.0.3", 80)); |
| 2408 } | 2408 } |
| 2409 | 2409 |
| 2410 TEST_F(HostResolverImplDnsTest, NoIPv6OnWifi) { | 2410 // TODO(crbug.com/728808): This test causes HttpNetworkTransactionTests to crash |
| 2411 // on iOS. |
| 2412 #if defined(OS_IOS) |
| 2413 #define MAYBE_NoIPv6OnWifi DISABLED_NoIPv6OnWifi |
| 2414 #else |
| 2415 #define MAYBE_NoIPv6OnWifi NoIPv6OnWifi |
| 2416 #endif |
| 2417 TEST_F(HostResolverImplDnsTest, MAYBE_NoIPv6OnWifi) { |
| 2411 test::ScopedMockNetworkChangeNotifier notifier; | 2418 test::ScopedMockNetworkChangeNotifier notifier; |
| 2412 CreateSerialResolver(); // To guarantee order of resolutions. | 2419 CreateSerialResolver(); // To guarantee order of resolutions. |
| 2413 resolver_->SetNoIPv6OnWifi(true); | 2420 resolver_->SetNoIPv6OnWifi(true); |
| 2414 | 2421 |
| 2415 notifier.mock_network_change_notifier()->SetConnectionType( | 2422 notifier.mock_network_change_notifier()->SetConnectionType( |
| 2416 NetworkChangeNotifier::CONNECTION_WIFI); | 2423 NetworkChangeNotifier::CONNECTION_WIFI); |
| 2417 // Needed so IPv6 availability check isn't skipped. | 2424 // Needed so IPv6 availability check isn't skipped. |
| 2418 ChangeDnsConfig(CreateValidDnsConfig()); | 2425 ChangeDnsConfig(CreateValidDnsConfig()); |
| 2419 | 2426 |
| 2420 proc_->AddRule("h1", ADDRESS_FAMILY_UNSPECIFIED, "::3"); | 2427 proc_->AddRule("h1", ADDRESS_FAMILY_UNSPECIFIED, "::3"); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2600 EXPECT_EQ(1, count2); | 2607 EXPECT_EQ(1, count2); |
| 2601 | 2608 |
| 2602 // Make another request to make sure both callbacks were cleared. | 2609 // Make another request to make sure both callbacks were cleared. |
| 2603 req = CreateRequest("just.testing", 80); | 2610 req = CreateRequest("just.testing", 80); |
| 2604 EXPECT_THAT(req->Resolve(), IsOk()); | 2611 EXPECT_THAT(req->Resolve(), IsOk()); |
| 2605 EXPECT_EQ(2, count1); | 2612 EXPECT_EQ(2, count1); |
| 2606 EXPECT_EQ(1, count2); | 2613 EXPECT_EQ(1, count2); |
| 2607 } | 2614 } |
| 2608 | 2615 |
| 2609 } // namespace net | 2616 } // namespace net |
| OLD | NEW |