| 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_BASE_NET_TEST_SUITE_H_ | 5 #ifndef NET_BASE_NET_TEST_SUITE_H_ |
| 6 #define NET_BASE_NET_TEST_SUITE_H_ | 6 #define NET_BASE_NET_TEST_SUITE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/test/test_suite.h" | 10 #include "base/test/test_suite.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "net/base/mock_host_resolver.h" | 12 #include "net/base/mock_host_resolver.h" |
| 13 | 13 |
| 14 class MessageLoop; | 14 class MessageLoop; |
| 15 | 15 |
| 16 namespace net { | 16 namespace net { |
| 17 class NetworkChangeNotifier; | 17 class NetworkChangeNotifier; |
| 18 } | 18 } |
| 19 | 19 |
| 20 class NetTestSuite : public base::TestSuite { | 20 class NetTestSuite : public base::TestSuite { |
| 21 public: | 21 public: |
| 22 NetTestSuite(int argc, char** argv); | 22 NetTestSuite(int argc, char** argv); |
| 23 virtual ~NetTestSuite(); | 23 virtual ~NetTestSuite(); |
| 24 | 24 |
| 25 virtual void Initialize(); | 25 virtual void Initialize() OVERRIDE; |
| 26 | 26 |
| 27 virtual void Shutdown(); | 27 virtual void Shutdown() OVERRIDE; |
| 28 | 28 |
| 29 protected: | 29 protected: |
| 30 | 30 |
| 31 // Called from within Initialize(), but separate so that derived classes | 31 // Called from within Initialize(), but separate so that derived classes |
| 32 // can initialize the NetTestSuite instance only and not | 32 // can initialize the NetTestSuite instance only and not |
| 33 // TestSuite::Initialize(). TestSuite::Initialize() performs some global | 33 // TestSuite::Initialize(). TestSuite::Initialize() performs some global |
| 34 // initialization that can only be done once. | 34 // initialization that can only be done once. |
| 35 void InitializeTestThread(); | 35 void InitializeTestThread(); |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; | 38 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; |
| 39 scoped_ptr<MessageLoop> message_loop_; | 39 scoped_ptr<MessageLoop> message_loop_; |
| 40 scoped_refptr<net::RuleBasedHostResolverProc> host_resolver_proc_; | 40 scoped_refptr<net::RuleBasedHostResolverProc> host_resolver_proc_; |
| 41 net::ScopedDefaultHostResolverProc scoped_host_resolver_proc_; | 41 net::ScopedDefaultHostResolverProc scoped_host_resolver_proc_; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 #endif // NET_BASE_NET_TEST_SUITE_H_ | 44 #endif // NET_BASE_NET_TEST_SUITE_H_ |
| OLD | NEW |