Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Side by Side Diff: net/base/net_test_suite.cc

Issue 8894008: Make CF net tests a content::BrowserMainParts. (Closed) Base URL: ssh://joi@192.168.1.201/home/joi/c/chrome/src@cfnettests
Patch Set: Address review comments, fix compile issues. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/base/net_test_suite.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "net/base/net_test_suite.h" 5 #include "net/base/net_test_suite.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "net/base/network_change_notifier.h" 8 #include "net/base/network_change_notifier.h"
9 #include "net/http/http_stream_factory.h" 9 #include "net/http/http_stream_factory.h"
10 #if defined(USE_NSS) 10 #if defined(USE_NSS)
(...skipping 27 matching lines...) Expand all
38 // We want to destroy this here before the TestSuite continues to tear down 38 // We want to destroy this here before the TestSuite continues to tear down
39 // the environment. 39 // the environment.
40 message_loop_.reset(); 40 message_loop_.reset();
41 41
42 TestSuite::Shutdown(); 42 TestSuite::Shutdown();
43 } 43 }
44 44
45 void NetTestSuite::InitializeTestThread() { 45 void NetTestSuite::InitializeTestThread() {
46 network_change_notifier_.reset(net::NetworkChangeNotifier::CreateMock()); 46 network_change_notifier_.reset(net::NetworkChangeNotifier::CreateMock());
47 47
48 InitializeTestThreadNoNetworkChangeNotifier();
49 }
50
51 void NetTestSuite::InitializeTestThreadNoNetworkChangeNotifier() {
48 host_resolver_proc_ = new net::RuleBasedHostResolverProc(NULL); 52 host_resolver_proc_ = new net::RuleBasedHostResolverProc(NULL);
49 scoped_host_resolver_proc_.Init(host_resolver_proc_.get()); 53 scoped_host_resolver_proc_.Init(host_resolver_proc_.get());
50 // In case any attempts are made to resolve host names, force them all to 54 // In case any attempts are made to resolve host names, force them all to
51 // be mapped to localhost. This prevents DNS queries from being sent in 55 // be mapped to localhost. This prevents DNS queries from being sent in
52 // the process of running these unit tests. 56 // the process of running these unit tests.
53 host_resolver_proc_->AddRule("*", "127.0.0.1"); 57 host_resolver_proc_->AddRule("*", "127.0.0.1");
54 58
55 message_loop_.reset(new MessageLoopForIO()); 59 message_loop_.reset(new MessageLoopForIO());
56 } 60 }
OLDNEW
« no previous file with comments | « net/base/net_test_suite.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698