| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef NET_TEST_NET_TEST_SUITE_H_ | 5 #ifndef NET_TEST_NET_TEST_SUITE_H_ |
| 6 #define NET_TEST_NET_TEST_SUITE_H_ | 6 #define NET_TEST_NET_TEST_SUITE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/test/test_suite.h" | 11 #include "base/test/test_suite.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "net/dns/mock_host_resolver.h" | 13 #include "net/dns/mock_host_resolver.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class MessageLoop; | 16 namespace test { |
| 17 class ScopedTaskEnvironment; |
| 18 } |
| 17 } | 19 } |
| 18 | 20 |
| 19 namespace net { | 21 namespace net { |
| 20 class NetworkChangeNotifier; | 22 class NetworkChangeNotifier; |
| 21 } | 23 } |
| 22 | 24 |
| 23 class NetTestSuite : public base::TestSuite { | 25 class NetTestSuite : public base::TestSuite { |
| 24 public: | 26 public: |
| 25 NetTestSuite(int argc, char** argv); | 27 NetTestSuite(int argc, char** argv); |
| 26 ~NetTestSuite() override; | 28 ~NetTestSuite() override; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 37 void InitializeTestThread(); | 39 void InitializeTestThread(); |
| 38 | 40 |
| 39 // Same as above, except it does not create a mock | 41 // Same as above, except it does not create a mock |
| 40 // NetworkChangeNotifier. Use this if your test needs to create and | 42 // NetworkChangeNotifier. Use this if your test needs to create and |
| 41 // manage its own mock NetworkChangeNotifier, or if your test uses | 43 // manage its own mock NetworkChangeNotifier, or if your test uses |
| 42 // the production NetworkChangeNotifier. | 44 // the production NetworkChangeNotifier. |
| 43 void InitializeTestThreadNoNetworkChangeNotifier(); | 45 void InitializeTestThreadNoNetworkChangeNotifier(); |
| 44 | 46 |
| 45 private: | 47 private: |
| 46 std::unique_ptr<net::NetworkChangeNotifier> network_change_notifier_; | 48 std::unique_ptr<net::NetworkChangeNotifier> network_change_notifier_; |
| 47 std::unique_ptr<base::MessageLoop> message_loop_; | 49 std::unique_ptr<base::test::ScopedTaskEnvironment> scoped_task_environment_; |
| 48 scoped_refptr<net::RuleBasedHostResolverProc> host_resolver_proc_; | 50 scoped_refptr<net::RuleBasedHostResolverProc> host_resolver_proc_; |
| 49 net::ScopedDefaultHostResolverProc scoped_host_resolver_proc_; | 51 net::ScopedDefaultHostResolverProc scoped_host_resolver_proc_; |
| 50 }; | 52 }; |
| 51 | 53 |
| 52 #endif // NET_TEST_NET_TEST_SUITE_H_ | 54 #endif // NET_TEST_NET_TEST_SUITE_H_ |
| OLD | NEW |