| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "config.h" | 5 #include "config.h" |
| 6 #include "platform/scheduler/CancellableTaskFactory.h" | 6 #include "platform/scheduler/CancellableTaskFactory.h" |
| 7 | 7 |
| 8 #include <gtest/gtest.h> | 8 #include <gtest/gtest.h> |
| 9 | 9 |
| 10 using blink::CancellableTaskFactory; | 10 namespace blink { |
| 11 using blink::WebThread; | |
| 12 | 11 |
| 13 namespace { | 12 using CancellableTaskFactoryTest = testing::Test; |
| 14 | |
| 15 typedef testing::Test CancellableTaskFactoryTest; | |
| 16 | 13 |
| 17 TEST_F(CancellableTaskFactoryTest, IsPending_TaskNotCreated) | 14 TEST_F(CancellableTaskFactoryTest, IsPending_TaskNotCreated) |
| 18 { | 15 { |
| 19 CancellableTaskFactory factory(nullptr); | 16 CancellableTaskFactory factory(nullptr); |
| 20 | 17 |
| 21 EXPECT_FALSE(factory.isPending()); | 18 EXPECT_FALSE(factory.isPending()); |
| 22 } | 19 } |
| 23 | 20 |
| 24 TEST_F(CancellableTaskFactoryTest, IsPending_TaskCreated) | 21 TEST_F(CancellableTaskFactoryTest, IsPending_TaskCreated) |
| 25 { | 22 { |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 OwnPtr<WebThread::Task> taskA = adoptPtr(factory.cancelAndCreate()); | 158 OwnPtr<WebThread::Task> taskA = adoptPtr(factory.cancelAndCreate()); |
| 162 OwnPtr<WebThread::Task> taskB = adoptPtr(factory.cancelAndCreate()); | 159 OwnPtr<WebThread::Task> taskB = adoptPtr(factory.cancelAndCreate()); |
| 163 | 160 |
| 164 taskA->run(); | 161 taskA->run(); |
| 165 EXPECT_EQ(0, executionCount); | 162 EXPECT_EQ(0, executionCount); |
| 166 | 163 |
| 167 taskB->run(); | 164 taskB->run(); |
| 168 EXPECT_EQ(1, executionCount); | 165 EXPECT_EQ(1, executionCount); |
| 169 } | 166 } |
| 170 | 167 |
| 171 } // namespace | 168 } // namespace blink |
| OLD | NEW |