OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |