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

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

Issue 2033753002: Remove use of deprecated MessageLoop methods in chrome/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: manual change Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
15 #include "base/files/file_util.h" 15 #include "base/files/file_util.h"
16 #include "base/location.h" 16 #include "base/location.h"
17 #include "base/macros.h" 17 #include "base/macros.h"
18 #include "base/message_loop/message_loop.h"
19 #include "base/path_service.h" 18 #include "base/path_service.h"
20 #include "base/run_loop.h" 19 #include "base/run_loop.h"
20 #include "base/single_thread_task_runner.h"
21 #include "base/threading/thread_task_runner_handle.h"
21 #include "chrome/browser/chrome_notification_types.h" 22 #include "chrome/browser/chrome_notification_types.h"
22 #include "chrome/browser/chromeos/policy/device_policy_builder.h" 23 #include "chrome/browser/chromeos/policy/device_policy_builder.h"
23 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" 24 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h"
24 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" 25 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h"
25 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" 26 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h"
26 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom eos.h" 27 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom eos.h"
27 #include "chrome/browser/chromeos/profiles/profile_helper.h" 28 #include "chrome/browser/chromeos/profiles/profile_helper.h"
28 #include "chrome/browser/lifetime/application_lifetime.h" 29 #include "chrome/browser/lifetime/application_lifetime.h"
29 #include "chrome/browser/policy/profile_policy_connector.h" 30 #include "chrome/browser/policy/profile_policy_connector.h"
30 #include "chrome/browser/policy/profile_policy_connector_factory.h" 31 #include "chrome/browser/policy/profile_policy_connector_factory.h"
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 void PowerPolicyLoginScreenBrowserTest::SetUpOnMainThread() { 293 void PowerPolicyLoginScreenBrowserTest::SetUpOnMainThread() {
293 PowerPolicyBrowserTestBase::SetUpOnMainThread(); 294 PowerPolicyBrowserTestBase::SetUpOnMainThread();
294 295
295 // Wait for the login screen to be shown. 296 // Wait for the login screen to be shown.
296 content::WindowedNotificationObserver( 297 content::WindowedNotificationObserver(
297 chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE, 298 chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
298 content::NotificationService::AllSources()).Wait(); 299 content::NotificationService::AllSources()).Wait();
299 } 300 }
300 301
301 void PowerPolicyLoginScreenBrowserTest::TearDownOnMainThread() { 302 void PowerPolicyLoginScreenBrowserTest::TearDownOnMainThread() {
302 base::MessageLoop::current()->PostTask(FROM_HERE, 303 base::ThreadTaskRunnerHandle::Get()->PostTask(
303 base::Bind(&chrome::AttemptExit)); 304 FROM_HERE, base::Bind(&chrome::AttemptExit));
304 base::RunLoop().RunUntilIdle(); 305 base::RunLoop().RunUntilIdle();
305 PowerPolicyBrowserTestBase::TearDownOnMainThread(); 306 PowerPolicyBrowserTestBase::TearDownOnMainThread();
306 } 307 }
307 308
308 PowerPolicyInSessionBrowserTest::PowerPolicyInSessionBrowserTest() { 309 PowerPolicyInSessionBrowserTest::PowerPolicyInSessionBrowserTest() {
309 } 310 }
310 311
311 void PowerPolicyInSessionBrowserTest::SetUpOnMainThread() { 312 void PowerPolicyInSessionBrowserTest::SetUpOnMainThread() {
312 PowerPolicyBrowserTestBase::SetUpOnMainThread(); 313 PowerPolicyBrowserTestBase::SetUpOnMainThread();
313 } 314 }
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 policy = baseline_policy; 513 policy = baseline_policy;
513 policy.set_ac_idle_action(power_manager_client_->policy().ac_idle_action()); 514 policy.set_ac_idle_action(power_manager_client_->policy().ac_idle_action());
514 policy.set_battery_idle_action( 515 policy.set_battery_idle_action(
515 power_manager_client_->policy().battery_idle_action()); 516 power_manager_client_->policy().battery_idle_action());
516 policy.set_reason(power_manager_client_->policy().reason()); 517 policy.set_reason(power_manager_client_->policy().reason());
517 EXPECT_EQ(GetDebugString(policy), 518 EXPECT_EQ(GetDebugString(policy),
518 GetDebugString(power_manager_client_->policy())); 519 GetDebugString(power_manager_client_->policy()));
519 } 520 }
520 521
521 } // namespace policy 522 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698