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

Side by Side Diff: remoting/base/auto_thread_task_runner_unittest.cc

Issue 19574007: Use a direct include of the message_loop header in remoting/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « remoting/base/auto_thread_task_runner.h ('k') | remoting/base/url_request_context.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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/memory/ref_counted.h" 6 #include "base/memory/ref_counted.h"
7 #include "base/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "remoting/base/auto_thread_task_runner.h" 8 #include "remoting/base/auto_thread_task_runner.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace { 11 namespace {
12 12
13 void SetFlagTask(bool* success) { 13 void SetFlagTask(bool* success) {
14 *success = true; 14 *success = true;
15 } 15 }
16 16
17 } // namespace 17 } // namespace
18 18
19 namespace remoting { 19 namespace remoting {
20 20
21 TEST(AutoThreadTaskRunnerTest, StartAndStop) { 21 TEST(AutoThreadTaskRunnerTest, StartAndStop) {
22 // Create a task runner. 22 // Create a task runner.
23 base::MessageLoop message_loop; 23 base::MessageLoop message_loop;
24 scoped_refptr<AutoThreadTaskRunner> task_runner = new AutoThreadTaskRunner( 24 scoped_refptr<AutoThreadTaskRunner> task_runner = new AutoThreadTaskRunner(
25 message_loop.message_loop_proxy(), base::MessageLoop::QuitClosure()); 25 message_loop.message_loop_proxy(), base::MessageLoop::QuitClosure());
26 26
27 // Post a task to make sure it is executed. 27 // Post a task to make sure it is executed.
28 bool success = false; 28 bool success = false;
29 message_loop.PostTask(FROM_HERE, base::Bind(&SetFlagTask, &success)); 29 message_loop.PostTask(FROM_HERE, base::Bind(&SetFlagTask, &success));
30 30
31 task_runner = NULL; 31 task_runner = NULL;
32 message_loop.Run(); 32 message_loop.Run();
33 EXPECT_TRUE(success); 33 EXPECT_TRUE(success);
34 } 34 }
35 35
36 } // namespace remoting 36 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/auto_thread_task_runner.h ('k') | remoting/base/url_request_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698