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