| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/common/local_discovery/service_discovery_client_impl.h" | 5 #include "chrome/common/local_discovery/service_discovery_client_impl.h" |
| 6 #include "net/dns/mdns_client_impl.h" | 6 #include "net/dns/mdns_client_impl.h" |
| 7 #include "net/dns/mock_mdns_socket_factory.h" | 7 #include "net/dns/mock_mdns_socket_factory.h" |
| 8 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 0x00, 0x10, | 53 0x00, 0x10, |
| 54 0x00, 0x10, // RDLENGTH is 4 bytes. | 54 0x00, 0x10, // RDLENGTH is 4 bytes. |
| 55 0x00, 0x0A, 0x00, 0x00, | 55 0x00, 0x0A, 0x00, 0x00, |
| 56 0x00, 0x00, 0x00, 0x00, | 56 0x00, 0x00, 0x00, 0x00, |
| 57 0x00, 0x01, 0x00, 0x02, | 57 0x00, 0x01, 0x00, 0x02, |
| 58 0x00, 0x03, 0x00, 0x04, | 58 0x00, 0x03, 0x00, 0x04, |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 class LocalDomainResolverTest : public testing::Test { | 61 class LocalDomainResolverTest : public testing::Test { |
| 62 public: | 62 public: |
| 63 virtual void SetUp() OVERRIDE { | 63 virtual void SetUp() override { |
| 64 mdns_client_.StartListening(&socket_factory_); | 64 mdns_client_.StartListening(&socket_factory_); |
| 65 } | 65 } |
| 66 | 66 |
| 67 std::string IPAddressToStringWithEmpty(const net::IPAddressNumber& address) { | 67 std::string IPAddressToStringWithEmpty(const net::IPAddressNumber& address) { |
| 68 if (address.empty()) return ""; | 68 if (address.empty()) return ""; |
| 69 return net::IPAddressToString(address); | 69 return net::IPAddressToString(address); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void AddressCallback(bool resolved, | 72 void AddressCallback(bool resolved, |
| 73 const net::IPAddressNumber& address_ipv4, | 73 const net::IPAddressNumber& address_ipv4, |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 resolver.Start(); | 174 resolver.Start(); |
| 175 | 175 |
| 176 EXPECT_CALL(*this, AddressCallbackInternal(false, "", "")); | 176 EXPECT_CALL(*this, AddressCallbackInternal(false, "", "")); |
| 177 | 177 |
| 178 RunFor(base::TimeDelta::FromSeconds(4)); | 178 RunFor(base::TimeDelta::FromSeconds(4)); |
| 179 } | 179 } |
| 180 | 180 |
| 181 } // namespace | 181 } // namespace |
| 182 | 182 |
| 183 } // namespace local_discovery | 183 } // namespace local_discovery |
| OLD | NEW |