OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_mojo.h" | 5 #include "net/dns/host_resolver_mojo.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "mojo/public/cpp/bindings/binding.h" |
10 #include "net/base/address_list.h" | 11 #include "net/base/address_list.h" |
11 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
12 #include "net/base/request_priority.h" | 13 #include "net/base/request_priority.h" |
13 #include "net/base/test_completion_callback.h" | 14 #include "net/base/test_completion_callback.h" |
14 #include "net/dns/mojo_host_type_converters.h" | 15 #include "net/dns/mojo_host_type_converters.h" |
15 #include "net/test/event_waiter.h" | 16 #include "net/test/event_waiter.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
17 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" | |
18 | 18 |
19 namespace net { | 19 namespace net { |
20 namespace { | 20 namespace { |
21 | 21 |
22 void Fail(int result) { | 22 void Fail(int result) { |
23 FAIL() << "Unexpected callback called with error " << result; | 23 FAIL() << "Unexpected callback called with error " << result; |
24 } | 24 } |
25 | 25 |
26 class MockMojoHostResolverRequest { | 26 class MockMojoHostResolverRequest { |
27 public: | 27 public: |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 EXPECT_EQ(ERR_DNS_CACHE_MISS, | 399 EXPECT_EQ(ERR_DNS_CACHE_MISS, |
400 resolver_->ResolveFromCache(request_info, &result, BoundNetLog())); | 400 resolver_->ResolveFromCache(request_info, &result, BoundNetLog())); |
401 EXPECT_TRUE(result.empty()); | 401 EXPECT_TRUE(result.empty()); |
402 } | 402 } |
403 | 403 |
404 TEST_F(HostResolverMojoTest, GetHostCache) { | 404 TEST_F(HostResolverMojoTest, GetHostCache) { |
405 EXPECT_TRUE(resolver_->GetHostCache()); | 405 EXPECT_TRUE(resolver_->GetHostCache()); |
406 } | 406 } |
407 | 407 |
408 } // namespace net | 408 } // namespace net |
OLD | NEW |