diff options
author | nya <nya@chromium.org> | 2016-03-23 03:12:33 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-23 10:13:46 +0000 |
commit | 1b5973d3a7a70a3446502035ef5431c7fda56518 (patch) | |
tree | 71ffc3e755a02b918d1d0382c96a04a88e1d7356 | |
parent | 26d91d2108a891ad9e0cfed8d15fbb312381fda1 (diff) | |
download | chromium_src-1b5973d3a7a70a3446502035ef5431c7fda56518.zip chromium_src-1b5973d3a7a70a3446502035ef5431c7fda56518.tar.gz chromium_src-1b5973d3a7a70a3446502035ef5431c7fda56518.tar.bz2 |
Revert of Add ArcEnabled policy implementation
Reason for revert:
This change broke --disable-arc-opt-in-verification used for
autotests.
> Add ArcEnabled policy implementation
>
> Hide "ARC OptIn" control from Chrome:Settings for enterprise users,
> map ArcEnabled policy to ArcEnabled pref.
>
> BUG=582440
>
> Review URL: https://codereview.chromium.org/1684063002
>
> Cr-Commit-Position: refs/heads/master@{#382266}
TBR=pbond@chromium.org,bartfab@chromium.org,jochen@chromium.org,dbeam@chromium.org,tnagel@chromium.org,hidehiko@chromium.org,hashimoto@chromium.org
BUG=582440
Review URL: https://codereview.chromium.org/1825143003
Cr-Commit-Position: refs/heads/master@{#382819}
20 files changed, 72 insertions, 243 deletions
diff --git a/chrome/browser/chromeos/arc/arc_auth_service.cc b/chrome/browser/chromeos/arc/arc_auth_service.cc index 60802a3..7dba38b 100644 --- a/chrome/browser/chromeos/arc/arc_auth_service.cc +++ b/chrome/browser/chromeos/arc/arc_auth_service.cc @@ -202,17 +202,24 @@ void ArcAuthService::OnPrimaryUserProfilePrepared(Profile* profile) { profile_, GURL(site_url)); CHECK(storage_partition_); - pref_change_registrar_.Init(profile_->GetPrefs()); - pref_change_registrar_.Add( - prefs::kArcEnabled, base::Bind(&ArcAuthService::OnOptInPreferenceChanged, - base::Unretained(this))); - if (profile_->GetPrefs()->GetBoolean(prefs::kArcEnabled)) { - OnOptInPreferenceChanged(); - } else { - if (!disable_ui_for_testing && profile_->IsNewProfile()) { - PrefServiceSyncableFromProfile(profile_)->AddObserver(this); - OnIsSyncingChanged(); + // In case UI is disabled we assume that ARC is opted-in. + if (!IsOptInVerificationDisabled()) { + pref_change_registrar_.Init(profile_->GetPrefs()); + pref_change_registrar_.Add( + prefs::kArcEnabled, + base::Bind(&ArcAuthService::OnOptInPreferenceChanged, + base::Unretained(this))); + if (profile_->GetPrefs()->GetBoolean(prefs::kArcEnabled)) { + OnOptInPreferenceChanged(); + } else { + if (!disable_ui_for_testing && profile_->IsNewProfile()) { + PrefServiceSyncableFromProfile(profile_)->AddObserver(this); + OnIsSyncingChanged(); + } } + } else { + auth_code_.clear(); + StartArc(); } } @@ -291,20 +298,16 @@ void ArcAuthService::OnOptInPreferenceChanged() { if (profile_->GetPrefs()->GetBoolean(prefs::kArcEnabled)) { if (state_ != State::ACTIVE) { + CloseUI(); auth_code_.clear(); - if (!IsOptInVerificationDisabled()) { - CloseUI(); - if (!profile_->GetPrefs()->GetBoolean(prefs::kArcSignedIn)) { - // Need pre-fetch auth code and show OptIn UI if needed. - initial_opt_in_ = true; - SetState(State::FETCHING_CODE); - FetchAuthCode(); - } else { - // Ready to start Arc. - StartArc(); - } + if (!profile_->GetPrefs()->GetBoolean(prefs::kArcSignedIn)) { + // Need pre-fetch auth code and show OptIn UI if needed. + initial_opt_in_ = true; + SetState(State::FETCHING_CODE); + FetchAuthCode(); } else { + // Ready to start Arc. StartArc(); } } diff --git a/chrome/browser/policy/DEPS b/chrome/browser/policy/DEPS index 382e9d0..468cb59 100644 --- a/chrome/browser/policy/DEPS +++ b/chrome/browser/policy/DEPS @@ -1,7 +1,6 @@ include_rules = [ "+chrome", "+chromeos", - "+components/arc/test", "+components/drive/drive_pref_names.h", "+components/user_manager", "+content/public/browser", diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc index ba007c9..5ee927f 100644 --- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc +++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc @@ -502,9 +502,6 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = { { key::kUnifiedDesktopEnabledByDefault, prefs::kUnifiedDesktopEnabledByDefault, base::Value::TYPE_BOOLEAN }, - { key::kArcEnabled, - prefs::kArcEnabled, - base::Value::TYPE_BOOLEAN }, #endif // defined(OS_CHROMEOS) // Metrics reporting is controlled by a platform specific policy for ChromeOS diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc index be00c54..eb72c63 100644 --- a/chrome/browser/policy/policy_browsertest.cc +++ b/chrome/browser/policy/policy_browsertest.cc @@ -191,20 +191,9 @@ #include "ash/shell.h" #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" #include "chrome/browser/chromeos/accessibility/magnification_manager.h" -#include "chrome/browser/chromeos/arc/arc_auth_service.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/ash/chrome_screenshot_grabber.h" -#include "chrome/browser/ui/ash/multi_user/multi_user_util.h" #include "chromeos/audio/cras_audio_handler.h" -#include "chromeos/chromeos_switches.h" -#include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/dbus/fake_session_manager_client.h" -#include "chromeos/dbus/session_manager_client.h" -#include "components/arc/arc_bridge_service.h" -#include "components/arc/arc_bridge_service_impl.h" -#include "components/arc/arc_service_manager.h" -#include "components/arc/test/fake_arc_bridge_bootstrap.h" -#include "components/arc/test/fake_arc_bridge_instance.h" #include "ui/chromeos/accessibility_types.h" #include "ui/keyboard/keyboard_util.h" #include "ui/snapshot/screenshot_grabber.h" @@ -4002,87 +3991,6 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, UnifiedDesktopEnabledByDefault) { UpdateProviderPolicy(policies); EXPECT_FALSE(display_manager->unified_desktop_enabled()); } - -class ArcPolicyTest : public PolicyTest { - public: - ArcPolicyTest() {} - ~ArcPolicyTest() override {} - - protected: - void SetUpTest() { - base::CommandLine::ForCurrentProcess()->AppendSwitch( - chromeos::switches::kDisableArcOptInVerification); - arc::ArcAuthService::DisableUIForTesting(); - - arc::ArcServiceManager::Get()->OnPrimaryUserProfilePrepared( - multi_user_util::GetAccountIdFromProfile(browser()->profile())); - arc::ArcAuthService::Get()->OnPrimaryUserProfilePrepared( - browser()->profile()); - } - - void TearDownTest() { - arc::ArcAuthService::Get()->Shutdown(); - } - - void SetUpInProcessBrowserTestFixture() override { - PolicyTest::SetUpInProcessBrowserTestFixture(); - fake_session_manager_client_ = new chromeos::FakeSessionManagerClient; - fake_session_manager_client_->set_arc_available(true); - chromeos::DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( - scoped_ptr<chromeos::SessionManagerClient>( - fake_session_manager_client_)); - - fake_arc_bridge_instance_.reset(new arc::FakeArcBridgeInstance); - arc::ArcServiceManager::SetArcBridgeServiceForTesting(make_scoped_ptr( - new arc::ArcBridgeServiceImpl(make_scoped_ptr( - new arc::FakeArcBridgeBootstrap( - fake_arc_bridge_instance_.get()))))); - } - - private: - chromeos::FakeSessionManagerClient *fake_session_manager_client_; - scoped_ptr<arc::FakeArcBridgeInstance> fake_arc_bridge_instance_; - - DISALLOW_COPY_AND_ASSIGN(ArcPolicyTest); -}; - -// Test ArcEnabled policy. -IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcEnabled) { - SetUpTest(); - - const PrefService* const pref = browser()->profile()->GetPrefs(); - const arc::ArcBridgeService* const arc_bridge_service - = arc::ArcBridgeService::Get(); - - // ARC is switched off by default. - EXPECT_EQ(arc::ArcBridgeService::State::STOPPED, arc_bridge_service->state()); - EXPECT_FALSE(pref->GetBoolean(prefs::kArcEnabled)); - - // Enable ARC. - PolicyMap policies; - policies.Set(key::kArcEnabled, - POLICY_LEVEL_MANDATORY, - POLICY_SCOPE_USER, - POLICY_SOURCE_CLOUD, - new base::FundamentalValue(true), - nullptr); - UpdateProviderPolicy(policies); - EXPECT_TRUE(pref->GetBoolean(prefs::kArcEnabled)); - EXPECT_EQ(arc::ArcBridgeService::State::READY, arc_bridge_service->state()); - - // Disable ARC. - policies.Set(key::kArcEnabled, - POLICY_LEVEL_MANDATORY, - POLICY_SCOPE_USER, - POLICY_SOURCE_CLOUD, - new base::FundamentalValue(false), - nullptr); - UpdateProviderPolicy(policies); - EXPECT_FALSE(pref->GetBoolean(prefs::kArcEnabled)); - EXPECT_EQ(arc::ArcBridgeService::State::STOPPED, arc_bridge_service->state()); - - TearDownTest(); -} #endif // defined(OS_CHROMEOS) } // namespace policy diff --git a/chrome/browser/resources/options/browser_options.html b/chrome/browser/resources/options/browser_options.html index 478ec4d..77ee6a1 100644 --- a/chrome/browser/resources/options/browser_options.html +++ b/chrome/browser/resources/options/browser_options.html @@ -222,7 +222,7 @@ </div> </section> <if expr="chromeos"> - <section id="android-apps-section" guest-visibility="hidden"> + <section id="andorid-apps-section" guest-visibility="hidden"> <h3 i18n-content="androidAppsTitle"></h3> <div class="checkbox controlled-setting-with-label"> <label> @@ -230,8 +230,6 @@ metric="Options_AndroidApps" type="checkbox"> <span> <span i18n-content="androidAppsEnabled"></span> - <span class="controlled-setting-indicator" - pref="arc.enabled"></span> </span> </label> </div> diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js index 60c23a2..2b63e80 100644 --- a/chrome/browser/resources/options/browser_options.js +++ b/chrome/browser/resources/options/browser_options.js @@ -2327,11 +2327,10 @@ cr.define('options', function() { }; /** - * Hides Android Apps settings when they are not available. - * (Chrome OS only). + * Hides Android Apps settings when they are not available (ChromeOS only). */ BrowserOptions.hideAndroidAppsSection = function() { - var section = $('android-apps-section'); + var section = $('andorid-apps-section'); if (section) section.hidden = true; }; diff --git a/chrome/browser/ui/webui/options/chromeos/guest_mode_options_browsertest.js b/chrome/browser/ui/webui/options/chromeos/guest_mode_options_browsertest.js index f4a0d0e..b7a52858 100644 --- a/chrome/browser/ui/webui/options/chromeos/guest_mode_options_browsertest.js +++ b/chrome/browser/ui/webui/options/chromeos/guest_mode_options_browsertest.js @@ -44,7 +44,7 @@ GuestModeOptionsUIBrowserTest.prototype = { TEST_F('GuestModeOptionsUIBrowserTest', 'testSections', function() { this.expectHidden($('startup-section')); this.expectHidden($('appearance-section')); - this.expectHidden($('android-apps-section')); + this.expectHidden($('andorid-apps-section')); this.expectHidden($('sync-users-section')); this.expectHidden($('easy-unlock-section')); this.expectHidden($('reset-profile-settings-section')); diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index a0d0adb..a907484 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -2401,7 +2401,6 @@ 'dependencies': [ '../build/linux/system.gyp:dbus', '../chromeos/ime/input_method.gyp:gencode', - '../components/components.gyp:arc_test_support', '../components/components.gyp:drive_test_support', '../dbus/dbus.gyp:dbus_test_support', '../ui/login/login.gyp:login_resources', diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 8214b25..85f4525 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn @@ -1046,7 +1046,6 @@ if (!is_android) { ] deps += [ "//chromeos/ime:gencode", - "//components/arc:arc_test_support", "//components/user_manager:test_support", "//dbus", "//dbus:test_support", diff --git a/chrome/test/data/policy/policy_test_cases.json b/chrome/test/data/policy/policy_test_cases.json index 7ce9e81..df5ef2e 100644 --- a/chrome/test/data/policy/policy_test_cases.json +++ b/chrome/test/data/policy/policy_test_cases.json @@ -2436,10 +2436,7 @@ "ArcEnabled": { "os": ["chromeos"], "can_be_recommended": false, - "test_policy": { "ArcEnabled": false }, - "pref_mappings": [ - { "pref": "arc.enabled" } - ] + "test_policy": { "ArcEnabled": false } }, "ArcApplicationPolicy": { diff --git a/chromeos/dbus/fake_session_manager_client.cc b/chromeos/dbus/fake_session_manager_client.cc index 58ffcd7..3c055b4 100644 --- a/chromeos/dbus/fake_session_manager_client.cc +++ b/chromeos/dbus/fake_session_manager_client.cc @@ -16,8 +16,7 @@ namespace chromeos { FakeSessionManagerClient::FakeSessionManagerClient() : start_device_wipe_call_count_(0), notify_lock_screen_shown_call_count_(0), - notify_lock_screen_dismissed_call_count_(0), - arc_available_(false) {} + notify_lock_screen_dismissed_call_count_(0) {} FakeSessionManagerClient::~FakeSessionManagerClient() { } @@ -153,19 +152,19 @@ void FakeSessionManagerClient::GetServerBackedStateKeys( void FakeSessionManagerClient::CheckArcAvailability( const ArcCallback& callback) { - base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, arc_available_)); + base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, + base::Bind(callback, false)); } void FakeSessionManagerClient::StartArcInstance(const std::string& socket_path, const ArcCallback& callback) { - base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, arc_available_)); + base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, + base::Bind(callback, false)); } void FakeSessionManagerClient::StopArcInstance(const ArcCallback& callback) { - base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, arc_available_)); + base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, + base::Bind(callback, false)); } const std::string& FakeSessionManagerClient::device_policy() const { diff --git a/chromeos/dbus/fake_session_manager_client.h b/chromeos/dbus/fake_session_manager_client.h index e5b594a..4150091 100644 --- a/chromeos/dbus/fake_session_manager_client.h +++ b/chromeos/dbus/fake_session_manager_client.h @@ -105,8 +105,6 @@ class FakeSessionManagerClient : public SessionManagerClient { return notify_lock_screen_dismissed_call_count_; } - void set_arc_available(bool available) { arc_available_ = available; } - private: std::string device_policy_; std::map<cryptohome::Identification, std::string> user_policies_; @@ -119,8 +117,6 @@ class FakeSessionManagerClient : public SessionManagerClient { int notify_lock_screen_shown_call_count_; int notify_lock_screen_dismissed_call_count_; - bool arc_available_; - DISALLOW_COPY_AND_ASSIGN(FakeSessionManagerClient); }; diff --git a/components/arc.gypi b/components/arc.gypi index 88d2aa6..6076304 100644 --- a/components/arc.gypi +++ b/components/arc.gypi @@ -73,8 +73,6 @@ 'sources': [ 'arc/test/fake_app_instance.cc', 'arc/test/fake_app_instance.h', - 'arc/test/fake_arc_bridge_bootstrap.cc', - 'arc/test/fake_arc_bridge_bootstrap.h', 'arc/test/fake_arc_bridge_instance.cc', 'arc/test/fake_arc_bridge_instance.h', 'arc/test/fake_arc_bridge_service.cc', diff --git a/components/arc/BUILD.gn b/components/arc/BUILD.gn index 70a07ae..68d79b8 100644 --- a/components/arc/BUILD.gn +++ b/components/arc/BUILD.gn @@ -89,8 +89,6 @@ static_library("arc_test_support") { sources = [ "test/fake_app_instance.cc", "test/fake_app_instance.h", - "test/fake_arc_bridge_bootstrap.cc", - "test/fake_arc_bridge_bootstrap.h", "test/fake_arc_bridge_instance.cc", "test/fake_arc_bridge_instance.h", "test/fake_arc_bridge_service.cc", diff --git a/components/arc/arc_bridge_bootstrap.cc b/components/arc/arc_bridge_bootstrap.cc index c9e44a1..1d7a94f 100644 --- a/components/arc/arc_bridge_bootstrap.cc +++ b/components/arc/arc_bridge_bootstrap.cc @@ -341,7 +341,6 @@ void ArcBridgeBootstrapImpl::SetState(State state) { } // namespace ArcBridgeBootstrap::ArcBridgeBootstrap() {} - ArcBridgeBootstrap::~ArcBridgeBootstrap() {} // static diff --git a/components/arc/arc_bridge_service_unittest.cc b/components/arc/arc_bridge_service_unittest.cc index e3eae59..c753f23 100644 --- a/components/arc/arc_bridge_service_unittest.cc +++ b/components/arc/arc_bridge_service_unittest.cc @@ -2,13 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <utility> + #include "base/bind.h" #include "base/bind_helpers.h" #include "base/macros.h" #include "base/run_loop.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "components/arc/arc_bridge_service_impl.h" -#include "components/arc/test/fake_arc_bridge_bootstrap.h" #include "components/arc/test/fake_arc_bridge_instance.h" #include "ipc/mojo/scoped_ipc_support.h" #include "mojo/public/cpp/system/message_pipe.h" @@ -16,6 +17,37 @@ namespace arc { +namespace { + +// A fake ArcBridgeBootstrap that creates a local connection. +class FakeArcBridgeBootstrap : public ArcBridgeBootstrap { + public: + explicit FakeArcBridgeBootstrap(FakeArcBridgeInstance* instance) + : instance_(instance) {} + ~FakeArcBridgeBootstrap() override {} + + void Start() override { + DCHECK(delegate_); + ArcBridgeInstancePtr instance; + instance_->Bind(mojo::GetProxy(&instance)); + delegate_->OnConnectionEstablished(std::move(instance)); + } + + void Stop() override { + DCHECK(delegate_); + instance_->Unbind(); + delegate_->OnStopped(); + } + + private: + // Owned by the caller. + FakeArcBridgeInstance* instance_; + + DISALLOW_COPY_AND_ASSIGN(FakeArcBridgeBootstrap); +}; + +} // namespace + class ArcBridgeTest : public testing::Test, public ArcBridgeService::Observer { public: ArcBridgeTest() : ready_(false) {} diff --git a/components/arc/arc_service_manager.cc b/components/arc/arc_service_manager.cc index bc54994..10388a2 100644 --- a/components/arc/arc_service_manager.cc +++ b/components/arc/arc_service_manager.cc @@ -24,23 +24,14 @@ namespace { // Weak pointer. This class is owned by ChromeBrowserMainPartsChromeos. ArcServiceManager* g_arc_service_manager = nullptr; -// This pointer is owned by ArcServiceManager. -ArcBridgeService* g_arc_bridge_service_for_testing = nullptr; - } // namespace -ArcServiceManager::ArcServiceManager() { +ArcServiceManager::ArcServiceManager() + : arc_bridge_service_( + new ArcBridgeServiceImpl(ArcBridgeBootstrap::Create())) { DCHECK(!g_arc_service_manager); g_arc_service_manager = this; - if (g_arc_bridge_service_for_testing) { - arc_bridge_service_.reset(g_arc_bridge_service_for_testing); - g_arc_bridge_service_for_testing = nullptr; - } else { - arc_bridge_service_.reset(new ArcBridgeServiceImpl( - ArcBridgeBootstrap::Create())); - } - AddService(make_scoped_ptr(new ArcClipboardBridge(arc_bridge_service()))); AddService( make_scoped_ptr(new ArcCrashCollectorBridge(arc_bridge_service()))); @@ -55,9 +46,6 @@ ArcServiceManager::~ArcServiceManager() { DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(g_arc_service_manager == this); g_arc_service_manager = nullptr; - if (g_arc_bridge_service_for_testing) { - delete g_arc_bridge_service_for_testing; - } } // static @@ -86,13 +74,4 @@ void ArcServiceManager::OnPrimaryUserProfilePrepared( new ArcNotificationManager(arc_bridge_service(), account_id))); } -//static -void ArcServiceManager::SetArcBridgeServiceForTesting( - scoped_ptr<ArcBridgeService> arc_bridge_service) { - if (g_arc_bridge_service_for_testing) { - delete g_arc_bridge_service_for_testing; - } - g_arc_bridge_service_for_testing = arc_bridge_service.release(); -} - } // namespace arc diff --git a/components/arc/arc_service_manager.h b/components/arc/arc_service_manager.h index 5c36f56..b3a1a6d 100644 --- a/components/arc/arc_service_manager.h +++ b/components/arc/arc_service_manager.h @@ -38,10 +38,6 @@ class ArcServiceManager { // Called when the main profile is initialized after user logs in. void OnPrimaryUserProfilePrepared(const AccountId& account_id); - // Set ArcBridgeService instance for testing. Call before ArcServiceManager - // creation. ArcServiceManager owns |arc_bridge_service|. - static void SetArcBridgeServiceForTesting( - scoped_ptr<ArcBridgeService> arc_bridge_service); private: base::ThreadChecker thread_checker_; scoped_ptr<ArcBridgeService> arc_bridge_service_; diff --git a/components/arc/test/fake_arc_bridge_bootstrap.cc b/components/arc/test/fake_arc_bridge_bootstrap.cc deleted file mode 100644 index d2d80bd..0000000 --- a/components/arc/test/fake_arc_bridge_bootstrap.cc +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/arc/test/fake_arc_bridge_bootstrap.h" - -#include <utility> - -#include "base/logging.h" -#include "components/arc/common/arc_bridge.mojom.h" -#include "components/arc/test/fake_arc_bridge_instance.h" -#include "mojo/public/cpp/bindings/interface_request.h" - -namespace arc { - -FakeArcBridgeBootstrap::FakeArcBridgeBootstrap(FakeArcBridgeInstance* instance) - : instance_(instance) { -} - -void FakeArcBridgeBootstrap::Start() { - DCHECK(delegate_); - ArcBridgeInstancePtr instance; - instance_->Bind(mojo::GetProxy(&instance)); - delegate_->OnConnectionEstablished(std::move(instance)); -} - -void FakeArcBridgeBootstrap::Stop() { - DCHECK(delegate_); - instance_->Unbind(); - delegate_->OnStopped(); -} - -} // namespace arc diff --git a/components/arc/test/fake_arc_bridge_bootstrap.h b/components/arc/test/fake_arc_bridge_bootstrap.h deleted file mode 100644 index feb7d6c..0000000 --- a/components/arc/test/fake_arc_bridge_bootstrap.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_BOOTSTRAP_H_ -#define COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_BOOTSTRAP_H_ - -#include "base/macros.h" -#include "components/arc/arc_bridge_bootstrap.h" - -namespace arc { - -class FakeArcBridgeInstance; - -// A fake ArcBridgeBootstrap that creates a local connection. -class FakeArcBridgeBootstrap : public ArcBridgeBootstrap { - public: - explicit FakeArcBridgeBootstrap(FakeArcBridgeInstance* instance); - ~FakeArcBridgeBootstrap() override {} - - // ArcBridgeBootstrap: - void Start() override; - void Stop() override; - - private: - // Owned by the caller. - FakeArcBridgeInstance* instance_; - - DISALLOW_COPY_AND_ASSIGN(FakeArcBridgeBootstrap); -}; - -} // namespace arc - -#endif // COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_BOOTSTRAP_H_ |