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

Side by Side Diff: chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc

Issue 1143343005: chrome/browser: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <string> 5 #include <string>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/location.h"
8 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
10 #include "base/prefs/testing_pref_service.h" 11 #include "base/prefs/testing_pref_service.h"
11 #include "base/run_loop.h" 12 #include "base/run_loop.h"
13 #include "base/single_thread_task_runner.h"
14 #include "base/thread_task_runner_handle.h"
12 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" 15 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h"
13 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h" 16 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h"
14 #include "chrome/browser/service_process/service_process_control.h" 17 #include "chrome/browser/service_process/service_process_control.h"
15 #include "chrome/browser/ui/startup/startup_browser_creator.h" 18 #include "chrome/browser/ui/startup/startup_browser_creator.h"
16 #include "chrome/common/chrome_switches.h" 19 #include "chrome/common/chrome_switches.h"
17 #include "chrome/common/cloud_print/cloud_print_proxy_info.h" 20 #include "chrome/common/cloud_print/cloud_print_proxy_info.h"
18 #include "chrome/common/pref_names.h" 21 #include "chrome/common/pref_names.h"
19 #include "chrome/common/service_messages.h" 22 #include "chrome/common/service_messages.h"
20 #include "chrome/test/base/testing_browser_process.h" 23 #include "chrome/test/base/testing_browser_process.h"
21 #include "chrome/test/base/testing_pref_service_syncable.h" 24 #include "chrome/test/base/testing_pref_service_syncable.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 return std::string("dorothy@somewhere.otr"); 84 return std::string("dorothy@somewhere.otr");
82 } 85 }
83 86
84 void CallTask(const base::Closure& task) { 87 void CallTask(const base::Closure& task) {
85 if (!task.is_null()) 88 if (!task.is_null())
86 task.Run(); 89 task.Run();
87 } 90 }
88 91
89 void PostTask(const base::Closure& task) { 92 void PostTask(const base::Closure& task) {
90 if (!task.is_null()) 93 if (!task.is_null())
91 base::MessageLoop::current()->PostTask(FROM_HERE, task); 94 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, task);
92 } 95 }
93 96
94 void MockServiceProcessControl::SetConnectSuccessMockExpectations( 97 void MockServiceProcessControl::SetConnectSuccessMockExpectations(
95 ServiceState service_state, 98 ServiceState service_state,
96 bool post_task) { 99 bool post_task) {
97 EXPECT_CALL(*this, IsConnected()).WillRepeatedly(ReturnPointee(&connected_)); 100 EXPECT_CALL(*this, IsConnected()).WillRepeatedly(ReturnPointee(&connected_));
98 101
99 EXPECT_CALL(*this, Launch(_, _)) 102 EXPECT_CALL(*this, Launch(_, _))
100 .WillRepeatedly( 103 .WillRepeatedly(
101 DoAll(Assign(&connected_, true), 104 DoAll(Assign(&connected_, true),
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 432
430 prefs->RemoveManagedPref(prefs::kCloudPrintProxyEnabled); 433 prefs->RemoveManagedPref(prefs::kCloudPrintProxyEnabled);
431 EXPECT_EQ(std::string(), prefs->GetString(prefs::kCloudPrintEmail)); 434 EXPECT_EQ(std::string(), prefs->GetString(prefs::kCloudPrintEmail));
432 435
433 service.GetMockServiceProcessControl()->SetWillBeEnabledExpectations(); 436 service.GetMockServiceProcessControl()->SetWillBeEnabledExpectations();
434 service.EnableForUser(); 437 service.EnableForUser();
435 438
436 EXPECT_EQ(MockServiceProcessControl::EnabledUserId(), 439 EXPECT_EQ(MockServiceProcessControl::EnabledUserId(),
437 prefs->GetString(prefs::kCloudPrintEmail)); 440 prefs->GetString(prefs::kCloudPrintEmail));
438 } 441 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698