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

Side by Side Diff: components/arc/test/fake_policy_instance.cc

Issue 2133503002: arc: Revamp the ArcBridgeService interface (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: More rebasing Created 4 years, 5 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 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 "components/arc/test/fake_policy_instance.h" 5 #include "components/arc/test/fake_policy_instance.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 7
8 namespace arc { 8 namespace arc {
9 9
10 FakePolicyInstance::FakePolicyInstance( 10 FakePolicyInstance::FakePolicyInstance(
11 mojo::InterfaceRequest<mojom::PolicyInstance> request, 11 mojo::InterfaceRequest<mojom::PolicyInstance> request,
12 ArcBridgeService* bridge_service) 12 ArcBridgeService* bridge_service)
13 : binding_(this, std::move(request)), bridge_service_(bridge_service) { 13 : binding_(this, std::move(request)), bridge_service_(bridge_service) {
14 bridge_service_->AddObserver(this); 14 bridge_service_->policy()->AddObserver(this);
15 } 15 }
16 16
17 FakePolicyInstance::~FakePolicyInstance() { 17 FakePolicyInstance::~FakePolicyInstance() {
18 bridge_service_->RemoveObserver(this); 18 bridge_service_->policy()->RemoveObserver(this);
19 } 19 }
20 20
21 void FakePolicyInstance::OnPolicyUpdated() {} 21 void FakePolicyInstance::OnPolicyUpdated() {}
22 22
23 void FakePolicyInstance::Init(mojom::PolicyHostPtr host_ptr) { 23 void FakePolicyInstance::Init(mojom::PolicyHostPtr host_ptr) {
24 host_ptr_ = std::move(host_ptr); 24 host_ptr_ = std::move(host_ptr);
25 } 25 }
26 26
27 void FakePolicyInstance::OnPolicyInstanceReady() { 27 void FakePolicyInstance::OnInstanceReady() {
28 ready_ = true; 28 ready_ = true;
29 } 29 }
30 30
31 void FakePolicyInstance::WaitForOnPolicyInstanceReady() { 31 void FakePolicyInstance::WaitForOnPolicyInstanceReady() {
32 while (!ready_) { 32 while (!ready_) {
33 base::RunLoop().RunUntilIdle(); 33 base::RunLoop().RunUntilIdle();
34 } 34 }
35 } 35 }
36 36
37 void FakePolicyInstance::CallGetPolicies( 37 void FakePolicyInstance::CallGetPolicies(
38 const mojom::PolicyHost::GetPoliciesCallback& callback) { 38 const mojom::PolicyHost::GetPoliciesCallback& callback) {
39 host_ptr_->GetPolicies(callback); 39 host_ptr_->GetPolicies(callback);
40 base::RunLoop().RunUntilIdle(); 40 base::RunLoop().RunUntilIdle();
41 } 41 }
42 42
43 } // namespace arc 43 } // namespace arc
OLDNEW
« no previous file with comments | « components/arc/test/fake_policy_instance.h ('k') | components/arc/window_manager/arc_window_manager_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698