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

Side by Side Diff: base/object_watcher_unittest.cc

Issue 552004: Style cleanup in preparation for auto-linting base/. (Closed)
Patch Set: Created 10 years, 11 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 | « base/message_pump_glib_unittest.cc ('k') | base/observer_list_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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <process.h> 5 #include <process.h>
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/object_watcher.h" 8 #include "base/object_watcher.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 class QuitDelegate : public base::ObjectWatcher::Delegate { 13 class QuitDelegate : public base::ObjectWatcher::Delegate {
14 public: 14 public:
15 virtual void OnObjectSignaled(HANDLE object) { 15 virtual void OnObjectSignaled(HANDLE object) {
16 MessageLoop::current()->Quit(); 16 MessageLoop::current()->Quit();
17 } 17 }
18 }; 18 };
19 19
20 class DecrementCountDelegate : public base::ObjectWatcher::Delegate { 20 class DecrementCountDelegate : public base::ObjectWatcher::Delegate {
21 public: 21 public:
22 DecrementCountDelegate(int* counter) : counter_(counter) { 22 explicit DecrementCountDelegate(int* counter) : counter_(counter) {
23 } 23 }
24 virtual void OnObjectSignaled(HANDLE object) { 24 virtual void OnObjectSignaled(HANDLE object) {
25 --(*counter_); 25 --(*counter_);
26 } 26 }
27 private: 27 private:
28 int* counter_; 28 int* counter_;
29 }; 29 };
30 30
31 } // namespace 31 } // namespace
32 32
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 RunTest_CancelAfterSet(MessageLoop::TYPE_DEFAULT); 134 RunTest_CancelAfterSet(MessageLoop::TYPE_DEFAULT);
135 RunTest_CancelAfterSet(MessageLoop::TYPE_IO); 135 RunTest_CancelAfterSet(MessageLoop::TYPE_IO);
136 RunTest_CancelAfterSet(MessageLoop::TYPE_UI); 136 RunTest_CancelAfterSet(MessageLoop::TYPE_UI);
137 } 137 }
138 138
139 TEST(ObjectWatcherTest, OutlivesMessageLoop) { 139 TEST(ObjectWatcherTest, OutlivesMessageLoop) {
140 RunTest_OutlivesMessageLoop(MessageLoop::TYPE_DEFAULT); 140 RunTest_OutlivesMessageLoop(MessageLoop::TYPE_DEFAULT);
141 RunTest_OutlivesMessageLoop(MessageLoop::TYPE_IO); 141 RunTest_OutlivesMessageLoop(MessageLoop::TYPE_IO);
142 RunTest_OutlivesMessageLoop(MessageLoop::TYPE_UI); 142 RunTest_OutlivesMessageLoop(MessageLoop::TYPE_UI);
143 } 143 }
OLDNEW
« no previous file with comments | « base/message_pump_glib_unittest.cc ('k') | base/observer_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698