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" |
(...skipping 16 matching lines...) Expand all Loading... |
27 virtual void Shutdown() OVERRIDE; | 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 // Same as above, except it does not create a mock |
| 38 // NetworkChangeNotifier. Use this if your test needs to create and |
| 39 // manage its own mock NetworkChangeNotifier, or if your test uses |
| 40 // the production NetworkChangeNotifier. |
| 41 void InitializeTestThreadNoNetworkChangeNotifier(); |
| 42 |
37 private: | 43 private: |
38 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; | 44 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; |
39 scoped_ptr<MessageLoop> message_loop_; | 45 scoped_ptr<MessageLoop> message_loop_; |
40 scoped_refptr<net::RuleBasedHostResolverProc> host_resolver_proc_; | 46 scoped_refptr<net::RuleBasedHostResolverProc> host_resolver_proc_; |
41 net::ScopedDefaultHostResolverProc scoped_host_resolver_proc_; | 47 net::ScopedDefaultHostResolverProc scoped_host_resolver_proc_; |
42 }; | 48 }; |
43 | 49 |
44 #endif // NET_BASE_NET_TEST_SUITE_H_ | 50 #endif // NET_BASE_NET_TEST_SUITE_H_ |
OLD | NEW |