| Index: third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
|
| diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
|
| index 9904efebe90c1d1137e7c3922762ffbd90d109f1..bd5b1043707e33fe4fa5744de21d30e6b6285e44 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
|
| @@ -2056,6 +2056,49 @@ TEST_F(PaintControllerTestBase,
|
| }
|
| }
|
|
|
| +TEST_F(PaintControllerTestBase, BeginAndEndFrame) {
|
| + class FakeFrame {};
|
| +
|
| + // PaintController should have one null frame in the stack since beginning.
|
| + GetPaintController().SetFirstPainted();
|
| + FrameFirstPaint result = GetPaintController().EndFrame(nullptr);
|
| + EXPECT_TRUE(result.first_painted);
|
| + EXPECT_FALSE(result.text_painted);
|
| + EXPECT_FALSE(result.image_painted);
|
| + // Readd the null frame.
|
| + GetPaintController().BeginFrame(nullptr);
|
| +
|
| + std::unique_ptr<FakeFrame> frame1(new FakeFrame);
|
| + GetPaintController().BeginFrame(frame1.get());
|
| + GetPaintController().SetFirstPainted();
|
| + GetPaintController().SetTextPainted();
|
| + GetPaintController().SetImagePainted();
|
| +
|
| + result = GetPaintController().EndFrame(frame1.get());
|
| + EXPECT_TRUE(result.first_painted);
|
| + EXPECT_TRUE(result.text_painted);
|
| + EXPECT_TRUE(result.image_painted);
|
| +
|
| + std::unique_ptr<FakeFrame> frame2(new FakeFrame);
|
| + GetPaintController().BeginFrame(frame2.get());
|
| + GetPaintController().SetFirstPainted();
|
| +
|
| + std::unique_ptr<FakeFrame> frame3(new FakeFrame);
|
| + GetPaintController().BeginFrame(frame3.get());
|
| + GetPaintController().SetTextPainted();
|
| + GetPaintController().SetImagePainted();
|
| +
|
| + result = GetPaintController().EndFrame(frame3.get());
|
| + EXPECT_FALSE(result.first_painted);
|
| + EXPECT_TRUE(result.text_painted);
|
| + EXPECT_TRUE(result.image_painted);
|
| +
|
| + result = GetPaintController().EndFrame(frame2.get());
|
| + EXPECT_TRUE(result.first_painted);
|
| + EXPECT_FALSE(result.text_painted);
|
| + EXPECT_FALSE(result.image_painted);
|
| +}
|
| +
|
| // Death tests don't work properly on Android.
|
| #if defined(GTEST_HAS_DEATH_TEST) && !OS(ANDROID)
|
|
|
|
|