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

Side by Side Diff: content/browser/browser_thread_unittest.cc

Issue 2133083002: Remove all remaining traces of MessageLoopProxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « content/browser/browser_thread_impl.cc ('k') | content/browser/byte_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <memory> 5 #include <memory>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 TEST_F(BrowserThreadTest, ReleasedOnCorrectThread) { 88 TEST_F(BrowserThreadTest, ReleasedOnCorrectThread) {
89 { 89 {
90 scoped_refptr<DeletedOnFile> test( 90 scoped_refptr<DeletedOnFile> test(
91 new DeletedOnFile(base::MessageLoop::current())); 91 new DeletedOnFile(base::MessageLoop::current()));
92 } 92 }
93 base::RunLoop().Run(); 93 base::RunLoop().Run();
94 } 94 }
95 95
96 TEST_F(BrowserThreadTest, PostTaskViaTaskRunner) { 96 TEST_F(BrowserThreadTest, PostTaskViaTaskRunner) {
97 scoped_refptr<base::SingleThreadTaskRunner> task_runner = 97 scoped_refptr<base::SingleThreadTaskRunner> task_runner =
98 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE); 98 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE);
99 task_runner->PostTask( 99 task_runner->PostTask(
100 FROM_HERE, base::Bind(&BasicFunction, base::MessageLoop::current())); 100 FROM_HERE, base::Bind(&BasicFunction, base::MessageLoop::current()));
101 base::RunLoop().Run(); 101 base::RunLoop().Run();
102 } 102 }
103 103
104 TEST_F(BrowserThreadTest, ReleaseViaTaskRunner) { 104 TEST_F(BrowserThreadTest, ReleaseViaTaskRunner) {
105 scoped_refptr<base::SingleThreadTaskRunner> task_runner = 105 scoped_refptr<base::SingleThreadTaskRunner> task_runner =
106 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI); 106 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI);
107 task_runner->ReleaseSoon(FROM_HERE, this); 107 task_runner->ReleaseSoon(FROM_HERE, this);
108 base::RunLoop().Run(); 108 base::RunLoop().Run();
109 } 109 }
110 110
111 TEST_F(BrowserThreadTest, PostTaskAndReply) { 111 TEST_F(BrowserThreadTest, PostTaskAndReply) {
112 // Most of the heavy testing for PostTaskAndReply() is done inside the 112 // Most of the heavy testing for PostTaskAndReply() is done inside the
113 // task runner test. This just makes sure we get piped through at all. 113 // task runner test. This just makes sure we get piped through at all.
114 ASSERT_TRUE(BrowserThread::PostTaskAndReply( 114 ASSERT_TRUE(BrowserThread::PostTaskAndReply(
115 BrowserThread::FILE, FROM_HERE, base::Bind(&base::DoNothing), 115 BrowserThread::FILE, FROM_HERE, base::Bind(&base::DoNothing),
116 base::Bind(&base::MessageLoop::QuitWhenIdle, 116 base::Bind(&base::MessageLoop::QuitWhenIdle,
117 base::Unretained(base::MessageLoop::current()->current())))); 117 base::Unretained(base::MessageLoop::current()->current()))));
118 base::RunLoop().Run(); 118 base::RunLoop().Run();
119 } 119 }
120 120
121 } // namespace content 121 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_thread_impl.cc ('k') | content/browser/byte_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698