| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/html/canvas/CanvasAsyncBlobCreator.h" | 5 #include "core/html/canvas/CanvasAsyncBlobCreator.h" |
| 6 | 6 |
| 7 #include "core/html/ImageData.h" | 7 #include "core/html/ImageData.h" |
| 8 #include "core/testing/DummyPageHolder.h" | 8 #include "core/testing/DummyPageHolder.h" |
| 9 #include "platform/testing/UnitTestHelpers.h" | 9 #include "platform/testing/UnitTestHelpers.h" |
| 10 #include "platform/wtf/Functional.h" | 10 #include "platform/wtf/Functional.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 nullptr) {} | 31 nullptr) {} |
| 32 | 32 |
| 33 CanvasAsyncBlobCreator::IdleTaskStatus GetIdleTaskStatus() { | 33 CanvasAsyncBlobCreator::IdleTaskStatus GetIdleTaskStatus() { |
| 34 return idle_task_status_; | 34 return idle_task_status_; |
| 35 } | 35 } |
| 36 | 36 |
| 37 MOCK_METHOD0(SignalTaskSwitchInStartTimeoutEventForTesting, void()); | 37 MOCK_METHOD0(SignalTaskSwitchInStartTimeoutEventForTesting, void()); |
| 38 MOCK_METHOD0(SignalTaskSwitchInCompleteTimeoutEventForTesting, void()); | 38 MOCK_METHOD0(SignalTaskSwitchInCompleteTimeoutEventForTesting, void()); |
| 39 | 39 |
| 40 protected: | 40 protected: |
| 41 void CreateBlobAndReturnResult() override{}; | 41 void CreateBlobAndReturnResult() override {} |
| 42 void CreateNullAndReturnResult() override{}; | 42 void CreateNullAndReturnResult() override {} |
| 43 void SignalAlternativeCodePathFinishedForTesting() override; | 43 void SignalAlternativeCodePathFinishedForTesting() override; |
| 44 void PostDelayedTaskToCurrentThread(const WebTraceLocation&, | 44 void PostDelayedTaskToCurrentThread(const WebTraceLocation&, |
| 45 std::unique_ptr<WTF::Closure>, | 45 std::unique_ptr<WTF::Closure>, |
| 46 double delay_ms) override; | 46 double delay_ms) override; |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 void MockCanvasAsyncBlobCreator::SignalAlternativeCodePathFinishedForTesting() { | 49 void MockCanvasAsyncBlobCreator::SignalAlternativeCodePathFinishedForTesting() { |
| 50 testing::ExitRunLoop(); | 50 testing::ExitRunLoop(); |
| 51 } | 51 } |
| 52 | 52 |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 JpegIdleTaskFailedWhenStartTimeoutEventHappens) { | 327 JpegIdleTaskFailedWhenStartTimeoutEventHappens) { |
| 328 this->PrepareMockCanvasAsyncBlobCreatorFailJpeg(); | 328 this->PrepareMockCanvasAsyncBlobCreatorFailJpeg(); |
| 329 | 329 |
| 330 this->AsyncBlobCreator()->ScheduleAsyncBlobCreation(1.0); | 330 this->AsyncBlobCreator()->ScheduleAsyncBlobCreation(1.0); |
| 331 testing::EnterRunLoop(); | 331 testing::EnterRunLoop(); |
| 332 | 332 |
| 333 EXPECT_EQ(IdleTaskStatus::kIdleTaskFailed, | 333 EXPECT_EQ(IdleTaskStatus::kIdleTaskFailed, |
| 334 this->AsyncBlobCreator()->GetIdleTaskStatus()); | 334 this->AsyncBlobCreator()->GetIdleTaskStatus()); |
| 335 } | 335 } |
| 336 } | 336 } |
| OLD | NEW |