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

Side by Side Diff: chrome/browser/chromeos/arc/intent_helper/arc_settings_service_browsertest.cc

Issue 2557513004: Remove explicit singletonness of ArcBridgeService part 3. (Closed)
Patch Set: Address comments. Created 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <memory> 5 #include <memory>
6 #include <string> 6 #include <string>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 fake_intent_helper_instance_.reset(new FakeIntentHelperInstance()); 211 fake_intent_helper_instance_.reset(new FakeIntentHelperInstance());
212 212
213 ArcServiceManager::SetArcBridgeServiceForTesting( 213 ArcServiceManager::SetArcBridgeServiceForTesting(
214 base::MakeUnique<FakeArcBridgeService>()); 214 base::MakeUnique<FakeArcBridgeService>());
215 } 215 }
216 216
217 void SetUpOnMainThread() override { 217 void SetUpOnMainThread() override {
218 SetupNetworkEnvironment(); 218 SetupNetworkEnvironment();
219 RunUntilIdle(); 219 RunUntilIdle();
220 220
221 ArcBridgeService::Get()->intent_helper()->SetInstance( 221 ArcServiceManager::Get()
222 fake_intent_helper_instance_.get()); 222 ->arc_bridge_service()
223 ->intent_helper()
224 ->SetInstance(fake_intent_helper_instance_.get());
223 } 225 }
224 226
225 void TearDownOnMainThread() override { 227 void TearDownOnMainThread() override {
226 ArcBridgeService::Get()->intent_helper()->SetInstance(nullptr); 228 ArcServiceManager::Get()
229 ->arc_bridge_service()
230 ->intent_helper()
231 ->SetInstance(nullptr);
227 } 232 }
228 233
229 void UpdatePolicy(const policy::PolicyMap& policy) { 234 void UpdatePolicy(const policy::PolicyMap& policy) {
230 provider_.UpdateChromePolicy(policy); 235 provider_.UpdateChromePolicy(policy);
231 RunUntilIdle(); 236 RunUntilIdle();
232 } 237 }
233 238
234 protected: 239 protected:
235 void DisconnectNetworkService(const std::string& service_path) { 240 void DisconnectNetworkService(const std::string& service_path) {
236 chromeos::ShillServiceClient::TestInterface* service_test = 241 chromeos::ShillServiceClient::TestInterface* service_test =
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 ProxyPrefs::kFixedServersProxyModeName); 526 ProxyPrefs::kFixedServersProxyModeName);
522 expected_proxy_config->SetString("host", "proxy-n300"); 527 expected_proxy_config->SetString("host", "proxy-n300");
523 expected_proxy_config->SetInteger("port", 3000); 528 expected_proxy_config->SetInteger("port", 3000);
524 529
525 EXPECT_EQ(CountProxyBroadcasts(fake_intent_helper_instance_->broadcasts(), 530 EXPECT_EQ(CountProxyBroadcasts(fake_intent_helper_instance_->broadcasts(),
526 expected_proxy_config.get()), 531 expected_proxy_config.get()),
527 1); 532 1);
528 } 533 }
529 534
530 } // namespace arc 535 } // namespace arc
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/arc/arc_session_manager_unittest.cc ('k') | chrome/browser/chromeos/policy/device_status_collector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698