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

Side by Side Diff: base/message_loop_unittest.cc

Issue 9958152: Consolidate win/x dispatchers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync, addressed comments 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
« no previous file with comments | « base/message_loop.h ('k') | base/message_pump_dispatcher.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 <vector> 5 #include <vector>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/eintr_wrapper.h" 10 #include "base/eintr_wrapper.h"
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 EXPECT_EQ(order.Get(10), TaskItem(QUITMESSAGELOOP, 6, true)); 1073 EXPECT_EQ(order.Get(10), TaskItem(QUITMESSAGELOOP, 6, true));
1074 EXPECT_EQ(order.Get(11), TaskItem(QUITMESSAGELOOP, 6, false)); 1074 EXPECT_EQ(order.Get(11), TaskItem(QUITMESSAGELOOP, 6, false));
1075 } 1075 }
1076 1076
1077 #if defined(OS_WIN) 1077 #if defined(OS_WIN)
1078 1078
1079 class DispatcherImpl : public MessageLoopForUI::Dispatcher { 1079 class DispatcherImpl : public MessageLoopForUI::Dispatcher {
1080 public: 1080 public:
1081 DispatcherImpl() : dispatch_count_(0) {} 1081 DispatcherImpl() : dispatch_count_(0) {}
1082 1082
1083 virtual bool Dispatch(const MSG& msg) { 1083 virtual bool Dispatch(const base::NativeEvent& msg) OVERRIDE {
1084 ::TranslateMessage(&msg); 1084 ::TranslateMessage(&msg);
1085 ::DispatchMessage(&msg); 1085 ::DispatchMessage(&msg);
1086 // Do not count WM_TIMER since it is not what we post and it will cause 1086 // Do not count WM_TIMER since it is not what we post and it will cause
1087 // flakiness. 1087 // flakiness.
1088 if (msg.message != WM_TIMER) 1088 if (msg.message != WM_TIMER)
1089 ++dispatch_count_; 1089 ++dispatch_count_;
1090 // We treat WM_LBUTTONUP as the last message. 1090 // We treat WM_LBUTTONUP as the last message.
1091 return msg.message != WM_LBUTTONUP; 1091 return msg.message != WM_LBUTTONUP;
1092 } 1092 }
1093 1093
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 base::Bind(&DestructionObserverProbe::Run, 1675 base::Bind(&DestructionObserverProbe::Run,
1676 new DestructionObserverProbe(&task_destroyed, 1676 new DestructionObserverProbe(&task_destroyed,
1677 &destruction_observer_called)), 1677 &destruction_observer_called)),
1678 kDelay); 1678 kDelay);
1679 delete loop; 1679 delete loop;
1680 EXPECT_TRUE(observer.task_destroyed_before_message_loop()); 1680 EXPECT_TRUE(observer.task_destroyed_before_message_loop());
1681 // The task should have been destroyed when we deleted the loop. 1681 // The task should have been destroyed when we deleted the loop.
1682 EXPECT_TRUE(task_destroyed); 1682 EXPECT_TRUE(task_destroyed);
1683 EXPECT_TRUE(destruction_observer_called); 1683 EXPECT_TRUE(destruction_observer_called);
1684 } 1684 }
OLDNEW
« no previous file with comments | « base/message_loop.h ('k') | base/message_pump_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698