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

Side by Side Diff: base/message_loop/message_loop_proxy_impl_unittest.cc

Issue 804533005: Standardize usage of virtual/override/final specifiers in base/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify Created 6 years 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 | « base/memory/singleton_unittest.cc ('k') | base/message_loop/message_loop_proxy_unittest.cc » ('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/message_loop/message_loop_proxy_impl.h" 5 #include "base/message_loop/message_loop_proxy_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 20 matching lines...) Expand all
31 MessageLoopProxy::current()); 31 MessageLoopProxy::current());
32 } 32 }
33 33
34 void AssertOnFileThread() const { 34 void AssertOnFileThread() const {
35 ASSERT_TRUE(file_thread_->message_loop_proxy()->BelongsToCurrentThread()); 35 ASSERT_TRUE(file_thread_->message_loop_proxy()->BelongsToCurrentThread());
36 ASSERT_EQ(file_thread_->message_loop_proxy(), 36 ASSERT_EQ(file_thread_->message_loop_proxy(),
37 MessageLoopProxy::current()); 37 MessageLoopProxy::current());
38 } 38 }
39 39
40 protected: 40 protected:
41 virtual void SetUp() override { 41 void SetUp() override {
42 io_thread_.reset(new Thread("MessageLoopProxyImplTest_IO")); 42 io_thread_.reset(new Thread("MessageLoopProxyImplTest_IO"));
43 file_thread_.reset(new Thread("MessageLoopProxyImplTest_File")); 43 file_thread_.reset(new Thread("MessageLoopProxyImplTest_File"));
44 io_thread_->Start(); 44 io_thread_->Start();
45 file_thread_->Start(); 45 file_thread_->Start();
46 } 46 }
47 47
48 virtual void TearDown() override { 48 void TearDown() override {
49 io_thread_->Stop(); 49 io_thread_->Stop();
50 file_thread_->Stop(); 50 file_thread_->Stop();
51 } 51 }
52 52
53 static void BasicFunction(MessageLoopProxyImplTest* test) { 53 static void BasicFunction(MessageLoopProxyImplTest* test) {
54 test->AssertOnFileThread(); 54 test->AssertOnFileThread();
55 test->Quit(); 55 test->Quit();
56 } 56 }
57 57
58 static void AssertNotRun() { 58 static void AssertNotRun() {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 test_thread->Start(); 120 test_thread->Start();
121 message_loop_proxy = test_thread->message_loop_proxy(); 121 message_loop_proxy = test_thread->message_loop_proxy();
122 } 122 }
123 bool ret = message_loop_proxy->PostTask( 123 bool ret = message_loop_proxy->PostTask(
124 FROM_HERE, 124 FROM_HERE,
125 Bind(&MessageLoopProxyImplTest::AssertNotRun)); 125 Bind(&MessageLoopProxyImplTest::AssertNotRun));
126 EXPECT_FALSE(ret); 126 EXPECT_FALSE(ret);
127 } 127 }
128 128
129 } // namespace base 129 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/singleton_unittest.cc ('k') | base/message_loop/message_loop_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698