| 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 "platform/scheduler/CancellableTaskFactory.h" | 5 #include "platform/scheduler/CancellableTaskFactory.h" |
| 6 | 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 class TestCancellableTaskFactory final : public CancellableTaskFactory { | 13 class TestCancellableTaskFactory final : public CancellableTaskFactory { |
| 14 public: | 14 public: |
| 15 explicit TestCancellableTaskFactory(PassOwnPtr<Closure> closure) | 15 explicit TestCancellableTaskFactory(PassOwnPtr<SameThreadClosure> closure) |
| 16 : CancellableTaskFactory(closure) | 16 : CancellableTaskFactory(closure) |
| 17 { | 17 { |
| 18 } | 18 } |
| 19 }; | 19 }; |
| 20 | 20 |
| 21 } // namespace | 21 } // namespace |
| 22 | 22 |
| 23 using CancellableTaskFactoryTest = testing::Test; | 23 using CancellableTaskFactoryTest = testing::Test; |
| 24 | 24 |
| 25 TEST_F(CancellableTaskFactoryTest, IsPending_TaskNotCreated) | 25 TEST_F(CancellableTaskFactoryTest, IsPending_TaskNotCreated) |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 OwnPtr<WebTaskRunner::Task> taskB = adoptPtr(factory.cancelAndCreate()); | 170 OwnPtr<WebTaskRunner::Task> taskB = adoptPtr(factory.cancelAndCreate()); |
| 171 | 171 |
| 172 taskA->run(); | 172 taskA->run(); |
| 173 EXPECT_EQ(0, executionCount); | 173 EXPECT_EQ(0, executionCount); |
| 174 | 174 |
| 175 taskB->run(); | 175 taskB->run(); |
| 176 EXPECT_EQ(1, executionCount); | 176 EXPECT_EQ(1, executionCount); |
| 177 } | 177 } |
| 178 | 178 |
| 179 } // namespace blink | 179 } // namespace blink |
| OLD | NEW |