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

Side by Side Diff: chrome/browser/io_thread_unittest.cc

Issue 2628903002: Change DONT_START_THREADS to DONT_CREATE_THREADS in TestBrowserThreadBundle. (Closed)
Patch Set: fix test error Created 3 years, 11 months 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 void CheckCanDelegate(bool expected, const GURL& url) { 101 void CheckCanDelegate(bool expected, const GURL& url) {
102 auto* http_auth_preferences = 102 auto* http_auth_preferences =
103 IOThreadPeer::GetAuthPreferences(io_thread_.get()); 103 IOThreadPeer::GetAuthPreferences(io_thread_.get());
104 EXPECT_EQ(expected, http_auth_preferences->CanDelegate(url)); 104 EXPECT_EQ(expected, http_auth_preferences->CanDelegate(url));
105 } 105 }
106 106
107 protected: 107 protected:
108 IOThreadTestWithIOThreadObject() 108 IOThreadTestWithIOThreadObject()
109 : thread_bundle_(content::TestBrowserThreadBundle::REAL_IO_THREAD | 109 : thread_bundle_(content::TestBrowserThreadBundle::REAL_IO_THREAD |
110 content::TestBrowserThreadBundle::DONT_START_THREADS) { 110 content::TestBrowserThreadBundle::DONT_CREATE_THREADS) {
111 #if BUILDFLAG(ENABLE_EXTENSIONS) 111 #if BUILDFLAG(ENABLE_EXTENSIONS)
112 event_router_forwarder_ = new extensions::EventRouterForwarder; 112 event_router_forwarder_ = new extensions::EventRouterForwarder;
113 #endif 113 #endif
114 PrefRegistrySimple* pref_registry = pref_service_.registry(); 114 PrefRegistrySimple* pref_registry = pref_service_.registry();
115 IOThread::RegisterPrefs(pref_registry); 115 IOThread::RegisterPrefs(pref_registry);
116 PrefProxyConfigTrackerImpl::RegisterPrefs(pref_registry); 116 PrefProxyConfigTrackerImpl::RegisterPrefs(pref_registry);
117 ssl_config::SSLConfigServiceManager::RegisterPrefs(pref_registry); 117 ssl_config::SSLConfigServiceManager::RegisterPrefs(pref_registry);
118 118
119 // Set up default function behaviour. 119 // Set up default function behaviour.
120 EXPECT_CALL(policy_service_, 120 EXPECT_CALL(policy_service_,
(...skipping 11 matching lines...) Expand all
132 io_thread_.reset(new IOThread(&pref_service_, &policy_service_, nullptr, 132 io_thread_.reset(new IOThread(&pref_service_, &policy_service_, nullptr,
133 #if BUILDFLAG(ENABLE_EXTENSIONS) 133 #if BUILDFLAG(ENABLE_EXTENSIONS)
134 event_router_forwarder_.get() 134 event_router_forwarder_.get()
135 #else 135 #else
136 nullptr 136 nullptr
137 #endif 137 #endif
138 )); 138 ));
139 // Now that IOThread object is registered starting the threads will 139 // Now that IOThread object is registered starting the threads will
140 // call the IOThread::Init(). This sets up the environment needed for 140 // call the IOThread::Init(). This sets up the environment needed for
141 // these tests. 141 // these tests.
142 thread_bundle_.Start(); 142 thread_bundle_.CreateThreads();
143 } 143 }
144 144
145 ~IOThreadTestWithIOThreadObject() override { 145 ~IOThreadTestWithIOThreadObject() override {
146 #if defined(USE_NSS_CERTS) 146 #if defined(USE_NSS_CERTS)
147 // Reset OCSPIOLoop thread checks, so that the test runner can run 147 // Reset OCSPIOLoop thread checks, so that the test runner can run
148 // futher tests in the same process. 148 // futher tests in the same process.
149 RunOnIOThreadBlocking(base::Bind(&net::ResetNSSHttpIOForTesting)); 149 RunOnIOThreadBlocking(base::Bind(&net::ResetNSSHttpIOForTesting));
150 #endif 150 #endif
151 #if defined(OS_CHROMEOS) 151 #if defined(OS_CHROMEOS)
152 chromeos::NetworkHandler::Shutdown(); 152 chromeos::NetworkHandler::Shutdown();
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 command_line_.AppendSwitchASCII("testing-fixed-http-port", "42"); 461 command_line_.AppendSwitchASCII("testing-fixed-http-port", "42");
462 command_line_.AppendSwitchASCII("testing-fixed-https-port", "137"); 462 command_line_.AppendSwitchASCII("testing-fixed-https-port", "137");
463 463
464 ConfigureParamsFromFieldTrialsAndCommandLine(); 464 ConfigureParamsFromFieldTrialsAndCommandLine();
465 465
466 EXPECT_EQ(42u, params_.testing_fixed_http_port); 466 EXPECT_EQ(42u, params_.testing_fixed_http_port);
467 EXPECT_EQ(137u, params_.testing_fixed_https_port); 467 EXPECT_EQ(137u, params_.testing_fixed_https_port);
468 } 468 }
469 469
470 } // namespace test 470 } // namespace test
OLDNEW
« no previous file with comments | « no previous file | content/public/test/test_browser_thread_bundle.h » ('j') | content/public/test/test_browser_thread_bundle.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698