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

Side by Side Diff: base/win/object_watcher_unittest.cc

Issue 11794032: base: Update the calls from MessageLoop::Quit() to QuitWhenIdle(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « base/timer_unittest.cc ('k') | no next file » | 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) 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 <process.h> 5 #include <process.h>
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/win/object_watcher.h" 8 #include "base/win/object_watcher.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 namespace win { 12 namespace win {
13 13
14 namespace { 14 namespace {
15 15
16 class QuitDelegate : public ObjectWatcher::Delegate { 16 class QuitDelegate : public ObjectWatcher::Delegate {
17 public: 17 public:
18 virtual void OnObjectSignaled(HANDLE object) { 18 virtual void OnObjectSignaled(HANDLE object) {
19 MessageLoop::current()->Quit(); 19 MessageLoop::current()->QuitWhenIdle();
20 } 20 }
21 }; 21 };
22 22
23 class DecrementCountDelegate : public ObjectWatcher::Delegate { 23 class DecrementCountDelegate : public ObjectWatcher::Delegate {
24 public: 24 public:
25 explicit DecrementCountDelegate(int* counter) : counter_(counter) { 25 explicit DecrementCountDelegate(int* counter) : counter_(counter) {
26 } 26 }
27 virtual void OnObjectSignaled(HANDLE object) { 27 virtual void OnObjectSignaled(HANDLE object) {
28 --(*counter_); 28 --(*counter_);
29 } 29 }
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } 163 }
164 164
165 TEST(ObjectWatcherTest, OutlivesMessageLoop) { 165 TEST(ObjectWatcherTest, OutlivesMessageLoop) {
166 RunTest_OutlivesMessageLoop(MessageLoop::TYPE_DEFAULT); 166 RunTest_OutlivesMessageLoop(MessageLoop::TYPE_DEFAULT);
167 RunTest_OutlivesMessageLoop(MessageLoop::TYPE_IO); 167 RunTest_OutlivesMessageLoop(MessageLoop::TYPE_IO);
168 RunTest_OutlivesMessageLoop(MessageLoop::TYPE_UI); 168 RunTest_OutlivesMessageLoop(MessageLoop::TYPE_UI);
169 } 169 }
170 170
171 } // namespace win 171 } // namespace win
172 } // namespace base 172 } // namespace base
OLDNEW
« no previous file with comments | « base/timer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698