#include "third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.h"
#include <list>
#include "components/ukm/test_ukm_recorder.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/html/canvas/image_data.h"
#include "third_party/blink/renderer/core/testing/page_test_base.h"
#include "third_party/blink/renderer/platform/graphics/color_correction_test_utils.h"
#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
#include "third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "third_party/skia/include/core/SkSurface.h"
namespace blink {
IdleTaskStatus;
class MockCanvasAsyncBlobCreator : public CanvasAsyncBlobCreator { … };
void MockCanvasAsyncBlobCreator::SignalAlternativeCodePathFinishedForTesting() { … }
void MockCanvasAsyncBlobCreator::PostDelayedTaskToCurrentThread(
const base::Location& location,
base::OnceClosure task,
double delay_ms) { … }
class MockCanvasAsyncBlobCreatorWithoutStart
: public MockCanvasAsyncBlobCreator { … };
class MockCanvasAsyncBlobCreatorWithoutComplete
: public MockCanvasAsyncBlobCreator { … };
class CanvasAsyncBlobCreatorTest : public PageTestBase { … };
CanvasAsyncBlobCreatorTest::CanvasAsyncBlobCreatorTest() = default;
scoped_refptr<StaticBitmapImage> CreateTransparentImage(int width, int height) { … }
void CanvasAsyncBlobCreatorTest::
PrepareMockCanvasAsyncBlobCreatorWithoutStart() { … }
void CanvasAsyncBlobCreatorTest::
PrepareMockCanvasAsyncBlobCreatorWithoutComplete() { … }
void CanvasAsyncBlobCreatorTest::PrepareMockCanvasAsyncBlobCreatorFail() { … }
void CanvasAsyncBlobCreatorTest::TearDown() { … }
TEST_F(CanvasAsyncBlobCreatorTest,
IdleTaskNotStartedWhenStartTimeoutEventHappens) { … }
TEST_F(CanvasAsyncBlobCreatorTest,
IdleTaskNotCompletedWhenCompleteTimeoutEventHappens) { … }
TEST_F(CanvasAsyncBlobCreatorTest, IdleTaskFailedWhenStartTimeoutEventHappens) { … }
}