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

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

Issue 2083363002: Remove calls to deprecated MessageLoop methods in chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 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/printing/cloud_print/privet_url_fetcher.h" 5 #include "chrome/browser/printing/cloud_print/privet_url_fetcher.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/run_loop.h"
10 #include "base/single_thread_task_runner.h" 11 #include "base/single_thread_task_runner.h"
11 #include "base/threading/thread_task_runner_handle.h" 12 #include "base/threading/thread_task_runner_handle.h"
12 #include "net/url_request/test_url_fetcher_factory.h" 13 #include "net/url_request/test_url_fetcher_factory.h"
13 #include "net/url_request/url_request_test_util.h" 14 #include "net/url_request/url_request_test_util.h"
14 #include "testing/gmock/include/gmock/gmock.h" 15 #include "testing/gmock/include/gmock/gmock.h"
15 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
16 17
17 using testing::StrictMock; 18 using testing::StrictMock;
18 19
19 namespace cloud_print { 20 namespace cloud_print {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 } 106 }
106 virtual ~PrivetURLFetcherTest() { 107 virtual ~PrivetURLFetcherTest() {
107 } 108 }
108 109
109 void RunFor(base::TimeDelta time_period) { 110 void RunFor(base::TimeDelta time_period) {
110 base::CancelableCallback<void()> callback(base::Bind( 111 base::CancelableCallback<void()> callback(base::Bind(
111 &PrivetURLFetcherTest::Stop, base::Unretained(this))); 112 &PrivetURLFetcherTest::Stop, base::Unretained(this)));
112 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( 113 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
113 FROM_HERE, callback.callback(), time_period); 114 FROM_HERE, callback.callback(), time_period);
114 115
115 base::MessageLoop::current()->Run(); 116 base::RunLoop().Run();
116 callback.Cancel(); 117 callback.Cancel();
117 } 118 }
118 119
119 void Stop() { base::MessageLoop::current()->QuitWhenIdle(); } 120 void Stop() { base::MessageLoop::current()->QuitWhenIdle(); }
120 121
121 protected: 122 protected:
122 base::MessageLoop loop_; 123 base::MessageLoop loop_;
123 scoped_refptr<net::TestURLRequestContextGetter> request_context_; 124 scoped_refptr<net::TestURLRequestContextGetter> request_context_;
124 net::TestURLFetcherFactory fetcher_factory_; 125 net::TestURLFetcherFactory fetcher_factory_;
125 std::unique_ptr<PrivetURLFetcher> privet_urlfetcher_; 126 std::unique_ptr<PrivetURLFetcher> privet_urlfetcher_;
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 net::OK)); 297 net::OK));
297 fetcher->set_response_code(200); 298 fetcher->set_response_code(200);
298 299
299 EXPECT_CALL(delegate_, OnFileInternal()); 300 EXPECT_CALL(delegate_, OnFileInternal());
300 fetcher->delegate()->OnURLFetchComplete(fetcher); 301 fetcher->delegate()->OnURLFetchComplete(fetcher);
301 } 302 }
302 303
303 } // namespace 304 } // namespace
304 305
305 } // namespace cloud_print 306 } // namespace cloud_print
OLDNEW
« no previous file with comments | « chrome/browser/printing/cloud_print/privet_http_unittest.cc ('k') | chrome/browser/printing/print_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698