OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/events/platform/platform_event_source.h" | 5 #include "ui/events/platform/platform_event_source.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 message_loop_.PostTask( | 495 message_loop_.PostTask( |
496 FROM_HERE, | 496 FROM_HERE, |
497 base::Bind(&PlatformEventTestWithMessageLoop::RunTest, | 497 base::Bind(&PlatformEventTestWithMessageLoop::RunTest, |
498 base::Unretained(this))); | 498 base::Unretained(this))); |
499 message_loop_.Run(); | 499 message_loop_.Run(); |
500 } | 500 } |
501 | 501 |
502 protected: | 502 protected: |
503 void RunTest() { | 503 void RunTest() { |
504 RunTestImpl(); | 504 RunTestImpl(); |
505 message_loop_.Quit(); | 505 message_loop_.QuitWhenIdle(); |
506 } | 506 } |
507 | 507 |
508 virtual void RunTestImpl() = 0; | 508 virtual void RunTestImpl() = 0; |
509 | 509 |
510 private: | 510 private: |
511 base::MessageLoopForUI message_loop_; | 511 base::MessageLoopForUI message_loop_; |
512 | 512 |
513 DISALLOW_COPY_AND_ASSIGN(PlatformEventTestWithMessageLoop); | 513 DISALLOW_COPY_AND_ASSIGN(PlatformEventTestWithMessageLoop); |
514 }; | 514 }; |
515 | 515 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 ASSERT_EQ(2u, list.size()); | 768 ASSERT_EQ(2u, list.size()); |
769 EXPECT_EQ(15, list[0]); | 769 EXPECT_EQ(15, list[0]); |
770 EXPECT_EQ(10, list[1]); | 770 EXPECT_EQ(10, list[1]); |
771 } | 771 } |
772 }; | 772 }; |
773 | 773 |
774 RUN_TEST_IN_MESSAGE_LOOP( | 774 RUN_TEST_IN_MESSAGE_LOOP( |
775 ConsecutiveOverriddenDispatcherInTheSameMessageLoopIteration) | 775 ConsecutiveOverriddenDispatcherInTheSameMessageLoopIteration) |
776 | 776 |
777 } // namespace ui | 777 } // namespace ui |
OLD | NEW |