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