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

Side by Side Diff: base/synchronization/waitable_event_watcher_unittest.cc

Issue 10004001: Add virtual and OVERRIDE to base/ implementation files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win Fix -> Missing header Created 8 years, 8 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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.h" 5 #include "base/message_loop.h"
6 #include "base/synchronization/waitable_event.h" 6 #include "base/synchronization/waitable_event.h"
7 #include "base/synchronization/waitable_event_watcher.h" 7 #include "base/synchronization/waitable_event_watcher.h"
8 #include "base/threading/platform_thread.h" 8 #include "base/threading/platform_thread.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace base { 11 namespace base {
12 12
13 namespace { 13 namespace {
14 14
15 class QuitDelegate : public WaitableEventWatcher::Delegate { 15 class QuitDelegate : public WaitableEventWatcher::Delegate {
16 public: 16 public:
17 virtual void OnWaitableEventSignaled(WaitableEvent* event) { 17 virtual void OnWaitableEventSignaled(WaitableEvent* event) OVERRIDE {
18 MessageLoop::current()->Quit(); 18 MessageLoop::current()->Quit();
19 } 19 }
20 }; 20 };
21 21
22 class DecrementCountDelegate : public WaitableEventWatcher::Delegate { 22 class DecrementCountDelegate : public WaitableEventWatcher::Delegate {
23 public: 23 public:
24 explicit DecrementCountDelegate(int* counter) : counter_(counter) { 24 explicit DecrementCountDelegate(int* counter) : counter_(counter) {
25 } 25 }
26 virtual void OnWaitableEventSignaled(WaitableEvent* object) { 26 virtual void OnWaitableEventSignaled(WaitableEvent* object) OVERRIDE {
27 --(*counter_); 27 --(*counter_);
28 } 28 }
29 private: 29 private:
30 int* counter_; 30 int* counter_;
31 }; 31 };
32 32
33 void RunTest_BasicSignal(MessageLoop::Type message_loop_type) { 33 void RunTest_BasicSignal(MessageLoop::Type message_loop_type) {
34 MessageLoop message_loop(message_loop_type); 34 MessageLoop message_loop(message_loop_type);
35 35
36 // A manual-reset event that is not yet signaled. 36 // A manual-reset event that is not yet signaled.
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 #else 156 #else
157 #define MAYBE_DeleteUnder DeleteUnder 157 #define MAYBE_DeleteUnder DeleteUnder
158 #endif 158 #endif
159 TEST(WaitableEventWatcherTest, MAYBE_DeleteUnder) { 159 TEST(WaitableEventWatcherTest, MAYBE_DeleteUnder) {
160 RunTest_DeleteUnder(MessageLoop::TYPE_DEFAULT); 160 RunTest_DeleteUnder(MessageLoop::TYPE_DEFAULT);
161 RunTest_DeleteUnder(MessageLoop::TYPE_IO); 161 RunTest_DeleteUnder(MessageLoop::TYPE_IO);
162 RunTest_DeleteUnder(MessageLoop::TYPE_UI); 162 RunTest_DeleteUnder(MessageLoop::TYPE_UI);
163 } 163 }
164 164
165 } // namespace base 165 } // namespace base
OLDNEW
« no previous file with comments | « base/synchronization/waitable_event_watcher_posix.cc ('k') | base/system_monitor/system_monitor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698