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

Unified Diff: chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc

Issue 342233005: Move ownership of the ComponentCloudPolicyService to the broker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc
diff --git a/chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc b/chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc
index 0f9160a7a19fda837efa627b41a451bd57904330..c77f9c1771784fb9de93c8ec8d1d460645a8675b 100644
--- a/chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc
+++ b/chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc
@@ -405,7 +405,9 @@ TEST_F(DeviceLocalAccountPolicyServiceTest, FetchPolicy) {
device_policy_.policy_data().device_id(),
_))
.WillOnce(SaveArg<6>(&request));
- EXPECT_CALL(service_observer_, OnPolicyUpdated(account_1_user_id_));
+ // This will be called twice, because the ComponentCloudPolicyService will
+ // also become ready after flushing all the pending tasks.
+ EXPECT_CALL(service_observer_, OnPolicyUpdated(account_1_user_id_)).Times(2);
broker->core()->client()->FetchPolicy();
FlushDeviceSettings();
Mock::VerifyAndClearExpectations(&service_observer_);
@@ -449,7 +451,9 @@ TEST_F(DeviceLocalAccountPolicyServiceTest, RefreshPolicy) {
.WillOnce(mock_device_management_service_.SucceedJob(response));
EXPECT_CALL(mock_device_management_service_, StartJob(_, _, _, _, _, _, _));
EXPECT_CALL(*this, OnRefreshDone(true)).Times(1);
- EXPECT_CALL(service_observer_, OnPolicyUpdated(account_1_user_id_));
+ // This will be called twice, because the ComponentCloudPolicyService will
+ // also become ready after flushing all the pending tasks.
+ EXPECT_CALL(service_observer_, OnPolicyUpdated(account_1_user_id_)).Times(2);
broker->core()->service()->RefreshPolicy(
base::Bind(&DeviceLocalAccountPolicyServiceTest::OnRefreshDone,
base::Unretained(this)));

Powered by Google App Engine
This is Rietveld 408576698