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

Side by Side Diff: chrome/browser/chromeos/policy/cloud_external_data_policy_observer_unittest.cc

Issue 1118773004: [chrome/browser/chromeos/policy] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Review Comments->2 Created 5 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/chromeos/policy/cloud_external_data_policy_observer.h" 5 #include "chrome/browser/chromeos/policy/cloud_external_data_policy_observer.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "base/files/file_util.h" 11 #include "base/files/file_util.h"
12 #include "base/json/json_writer.h" 12 #include "base/json/json_writer.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/message_loop/message_loop.h"
15 #include "base/message_loop/message_loop_proxy.h"
16 #include "base/path_service.h" 14 #include "base/path_service.h"
17 #include "base/run_loop.h" 15 #include "base/run_loop.h"
16 #include "base/thread_task_runner_handle.h"
18 #include "base/values.h" 17 #include "base/values.h"
19 #include "chrome/browser/chrome_notification_types.h" 18 #include "chrome/browser/chrome_notification_types.h"
20 #include "chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_u til.h" 19 #include "chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_u til.h"
21 #include "chrome/browser/chromeos/policy/device_local_account.h" 20 #include "chrome/browser/chromeos/policy/device_local_account.h"
22 #include "chrome/browser/chromeos/policy/device_local_account_external_data_mana ger.h" 21 #include "chrome/browser/chromeos/policy/device_local_account_external_data_mana ger.h"
23 #include "chrome/browser/chromeos/policy/device_local_account_policy_provider.h" 22 #include "chrome/browser/chromeos/policy/device_local_account_policy_provider.h"
24 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" 23 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h"
25 #include "chrome/browser/chromeos/policy/fake_affiliated_invalidation_service_pr ovider.h" 24 #include "chrome/browser/chromeos/policy/fake_affiliated_invalidation_service_pr ovider.h"
26 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" 25 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h"
27 #include "chrome/browser/chromeos/profiles/profile_helper.h" 26 #include "chrome/browser/chromeos/profiles/profile_helper.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 CloudExternalDataPolicyObserverTest::~CloudExternalDataPolicyObserverTest() { 177 CloudExternalDataPolicyObserverTest::~CloudExternalDataPolicyObserverTest() {
179 } 178 }
180 179
181 void CloudExternalDataPolicyObserverTest::SetUp() { 180 void CloudExternalDataPolicyObserverTest::SetUp() {
182 chromeos::DeviceSettingsTestBase::SetUp(); 181 chromeos::DeviceSettingsTestBase::SetUp();
183 182
184 ASSERT_TRUE(profile_manager_.SetUp()); 183 ASSERT_TRUE(profile_manager_.SetUp());
185 184
186 device_local_account_policy_service_.reset( 185 device_local_account_policy_service_.reset(
187 new DeviceLocalAccountPolicyService( 186 new DeviceLocalAccountPolicyService(
188 &device_settings_test_helper_, 187 &device_settings_test_helper_, &device_settings_service_,
189 &device_settings_service_, 188 &cros_settings_, &affiliated_invalidation_service_provider_,
190 &cros_settings_, 189 base::ThreadTaskRunnerHandle::Get(),
191 &affiliated_invalidation_service_provider_, 190 base::ThreadTaskRunnerHandle::Get(),
192 base::MessageLoopProxy::current(), 191 base::ThreadTaskRunnerHandle::Get(),
193 base::MessageLoopProxy::current(), 192 base::ThreadTaskRunnerHandle::Get(), nullptr));
194 base::MessageLoopProxy::current(),
195 base::MessageLoopProxy::current(),
196 nullptr));
197 url_fetcher_factory_.set_remove_fetcher_on_delete(true); 193 url_fetcher_factory_.set_remove_fetcher_on_delete(true);
198 194
199 EXPECT_CALL(user_policy_provider_, IsInitializationComplete(_)) 195 EXPECT_CALL(user_policy_provider_, IsInitializationComplete(_))
200 .WillRepeatedly(Return(true)); 196 .WillRepeatedly(Return(true));
201 user_policy_provider_.Init(); 197 user_policy_provider_.Init();
202 198
203 ConstructAvatarPolicy("avatar1.jpg", 199 ConstructAvatarPolicy("avatar1.jpg",
204 kAvatar1URL, 200 kAvatar1URL,
205 &avatar_policy_1_data_, 201 &avatar_policy_1_data_,
206 &avatar_policy_1_); 202 &avatar_policy_1_);
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 950
955 EXPECT_TRUE(set_calls_.empty()); 951 EXPECT_TRUE(set_calls_.empty());
956 EXPECT_TRUE(cleared_calls_.empty()); 952 EXPECT_TRUE(cleared_calls_.empty());
957 ASSERT_EQ(1u, fetched_calls_.size()); 953 ASSERT_EQ(1u, fetched_calls_.size());
958 EXPECT_EQ(kRegularUserID, fetched_calls_.front().first); 954 EXPECT_EQ(kRegularUserID, fetched_calls_.front().first);
959 EXPECT_EQ(avatar_policy_2_data_, fetched_calls_.front().second); 955 EXPECT_EQ(avatar_policy_2_data_, fetched_calls_.front().second);
960 ClearObservations(); 956 ClearObservations();
961 } 957 }
962 958
963 } // namespace policy 959 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698