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

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

Issue 2571763003: Reduce FakeArcBridgeService usage. (Closed)
Patch Set: 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"
11 #include "base/json/json_reader.h" 11 #include "base/json/json_reader.h"
12 #include "base/memory/ptr_util.h" 12 #include "base/memory/ptr_util.h"
13 #include "base/run_loop.h" 13 #include "base/run_loop.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "chrome/browser/chromeos/arc/intent_helper/arc_settings_service.h" 15 #include "chrome/browser/chromeos/arc/intent_helper/arc_settings_service.h"
16 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/ui/browser.h" 17 #include "chrome/browser/ui/browser.h"
18 #include "chrome/test/base/in_process_browser_test.h" 18 #include "chrome/test/base/in_process_browser_test.h"
19 #include "chromeos/dbus/dbus_thread_manager.h" 19 #include "chromeos/dbus/dbus_thread_manager.h"
20 #include "chromeos/dbus/shill_profile_client.h" 20 #include "chromeos/dbus/shill_profile_client.h"
21 #include "chromeos/dbus/shill_service_client.h" 21 #include "chromeos/dbus/shill_service_client.h"
22 #include "chromeos/network/network_handler.h" 22 #include "chromeos/network/network_handler.h"
23 #include "chromeos/network/network_state.h" 23 #include "chromeos/network/network_state.h"
24 #include "chromeos/network/network_state_handler.h" 24 #include "chromeos/network/network_state_handler.h"
25 #include "chromeos/network/proxy/proxy_config_handler.h" 25 #include "chromeos/network/proxy/proxy_config_handler.h"
26 #include "components/arc/arc_bridge_service.h"
26 #include "components/arc/arc_service_manager.h" 27 #include "components/arc/arc_service_manager.h"
27 #include "components/arc/test/fake_arc_bridge_service.h"
28 #include "components/arc/test/fake_intent_helper_instance.h" 28 #include "components/arc/test/fake_intent_helper_instance.h"
29 #include "components/policy/core/browser/browser_policy_connector.h" 29 #include "components/policy/core/browser/browser_policy_connector.h"
30 #include "components/policy/core/common/mock_configuration_policy_provider.h" 30 #include "components/policy/core/common/mock_configuration_policy_provider.h"
31 #include "components/policy/core/common/policy_map.h" 31 #include "components/policy/core/common/policy_map.h"
32 #include "components/policy/core/common/policy_types.h" 32 #include "components/policy/core/common/policy_types.h"
33 #include "components/policy/policy_constants.h" 33 #include "components/policy/policy_constants.h"
34 #include "components/prefs/pref_service.h" 34 #include "components/prefs/pref_service.h"
35 #include "components/proxy_config/proxy_config_dictionary.h" 35 #include "components/proxy_config/proxy_config_dictionary.h"
36 #include "components/proxy_config/proxy_config_pref_names.h" 36 #include "components/proxy_config/proxy_config_pref_names.h"
37 #include "components/proxy_config/proxy_prefs.h" 37 #include "components/proxy_config/proxy_prefs.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 ArcSettingsServiceTest() = default; 202 ArcSettingsServiceTest() = default;
203 203
204 // InProcessBrowserTest: 204 // InProcessBrowserTest:
205 ~ArcSettingsServiceTest() override = default; 205 ~ArcSettingsServiceTest() override = default;
206 206
207 void SetUpInProcessBrowserTestFixture() override { 207 void SetUpInProcessBrowserTestFixture() override {
208 EXPECT_CALL(provider_, IsInitializationComplete(_)) 208 EXPECT_CALL(provider_, IsInitializationComplete(_))
209 .WillRepeatedly(Return(true)); 209 .WillRepeatedly(Return(true));
210 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); 210 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_);
211 fake_intent_helper_instance_.reset(new FakeIntentHelperInstance()); 211 fake_intent_helper_instance_.reset(new FakeIntentHelperInstance());
212
213 ArcServiceManager::SetArcBridgeServiceForTesting(
214 base::MakeUnique<FakeArcBridgeService>());
215 } 212 }
216 213
217 void SetUpOnMainThread() override { 214 void SetUpOnMainThread() override {
218 SetupNetworkEnvironment(); 215 SetupNetworkEnvironment();
219 RunUntilIdle(); 216 RunUntilIdle();
220 217
221 ArcServiceManager::Get() 218 ArcServiceManager::Get()
222 ->arc_bridge_service() 219 ->arc_bridge_service()
223 ->intent_helper() 220 ->intent_helper()
224 ->SetInstance(fake_intent_helper_instance_.get()); 221 ->SetInstance(fake_intent_helper_instance_.get());
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 ProxyPrefs::kFixedServersProxyModeName); 523 ProxyPrefs::kFixedServersProxyModeName);
527 expected_proxy_config->SetString("host", "proxy-n300"); 524 expected_proxy_config->SetString("host", "proxy-n300");
528 expected_proxy_config->SetInteger("port", 3000); 525 expected_proxy_config->SetInteger("port", 3000);
529 526
530 EXPECT_EQ(CountProxyBroadcasts(fake_intent_helper_instance_->broadcasts(), 527 EXPECT_EQ(CountProxyBroadcasts(fake_intent_helper_instance_->broadcasts(),
531 expected_proxy_config.get()), 528 expected_proxy_config.get()),
532 1); 529 1);
533 } 530 }
534 531
535 } // namespace arc 532 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698