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 /components/arc/arc_bridge_service_unittest.cc | |
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}
Diffstat (limited to 'components/arc/arc_bridge_service_unittest.cc')
-rw-r--r-- | components/arc/arc_bridge_service_unittest.cc | 34 |
1 files changed, 33 insertions, 1 deletions
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) {} |