OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 //----------------------------------------------------------------------------- | 574 //----------------------------------------------------------------------------- |
575 // Each test is run against each type of MessageLoop. That way we are sure | 575 // Each test is run against each type of MessageLoop. That way we are sure |
576 // that message loops work properly in all configurations. Of course, in some | 576 // that message loops work properly in all configurations. Of course, in some |
577 // cases, a unit test may only be for a particular type of loop. | 577 // cases, a unit test may only be for a particular type of loop. |
578 | 578 |
579 RUN_MESSAGE_LOOP_TESTS(Default, &TypeDefaultMessagePumpFactory); | 579 RUN_MESSAGE_LOOP_TESTS(Default, &TypeDefaultMessagePumpFactory); |
580 RUN_MESSAGE_LOOP_TESTS(UI, &TypeUIMessagePumpFactory); | 580 RUN_MESSAGE_LOOP_TESTS(UI, &TypeUIMessagePumpFactory); |
581 RUN_MESSAGE_LOOP_TESTS(IO, &TypeIOMessagePumpFactory); | 581 RUN_MESSAGE_LOOP_TESTS(IO, &TypeIOMessagePumpFactory); |
582 | 582 |
583 #if defined(OS_WIN) | 583 #if defined(OS_WIN) |
| 584 // Additional set of tests for GPU version of UI message loop. |
| 585 RUN_MESSAGE_LOOP_TESTS(GPU, &MessagePumpForGpu::CreateMessagePumpForGpu); |
| 586 |
584 TEST(MessageLoopTest, PostDelayedTask_SharedTimer_SubPump) { | 587 TEST(MessageLoopTest, PostDelayedTask_SharedTimer_SubPump) { |
585 RunTest_PostDelayedTask_SharedTimer_SubPump(); | 588 RunTest_PostDelayedTask_SharedTimer_SubPump(); |
586 } | 589 } |
587 | 590 |
588 // This test occasionally hangs. See http://crbug.com/44567. | 591 // This test occasionally hangs. See http://crbug.com/44567. |
589 TEST(MessageLoopTest, DISABLED_RecursiveDenial2) { | 592 TEST(MessageLoopTest, DISABLED_RecursiveDenial2) { |
590 RunTest_RecursiveDenial2(MessageLoop::TYPE_DEFAULT); | 593 RunTest_RecursiveDenial2(MessageLoop::TYPE_DEFAULT); |
591 RunTest_RecursiveDenial2(MessageLoop::TYPE_UI); | 594 RunTest_RecursiveDenial2(MessageLoop::TYPE_UI); |
592 RunTest_RecursiveDenial2(MessageLoop::TYPE_IO); | 595 RunTest_RecursiveDenial2(MessageLoop::TYPE_IO); |
593 } | 596 } |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 // already has another active loop. This happens when thread creation fails. | 973 // already has another active loop. This happens when thread creation fails. |
971 MessageLoop loop; | 974 MessageLoop loop; |
972 std::unique_ptr<MessageLoop> unbound_loop(MessageLoop::CreateUnbound( | 975 std::unique_ptr<MessageLoop> unbound_loop(MessageLoop::CreateUnbound( |
973 MessageLoop::TYPE_DEFAULT, MessageLoop::MessagePumpFactoryCallback())); | 976 MessageLoop::TYPE_DEFAULT, MessageLoop::MessagePumpFactoryCallback())); |
974 unbound_loop.reset(); | 977 unbound_loop.reset(); |
975 EXPECT_EQ(&loop, MessageLoop::current()); | 978 EXPECT_EQ(&loop, MessageLoop::current()); |
976 EXPECT_EQ(loop.task_runner(), ThreadTaskRunnerHandle::Get()); | 979 EXPECT_EQ(loop.task_runner(), ThreadTaskRunnerHandle::Get()); |
977 } | 980 } |
978 | 981 |
979 } // namespace base | 982 } // namespace base |
OLD | NEW |