| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "ppapi/tests/test_paint_aggregator.h" | 5 #include "ppapi/tests/test_paint_aggregator.h" |
| 6 | 6 |
| 7 #include "ppapi/cpp/paint_aggregator.h" | 7 #include "ppapi/cpp/paint_aggregator.h" |
| 8 #include "ppapi/tests/testing_instance.h" | 8 #include "ppapi/tests/testing_instance.h" |
| 9 | 9 |
| 10 REGISTER_TEST_CASE(PaintAggregator); | 10 REGISTER_TEST_CASE(PaintAggregator); |
| 11 | 11 |
| 12 bool TestPaintAggregator::Init() { | 12 bool TestPaintAggregator::Init() { |
| 13 return true; | 13 return true; |
| 14 } | 14 } |
| 15 | 15 |
| 16 void TestPaintAggregator::RunTest() { | 16 void TestPaintAggregator::RunTests(const std::string& filter) { |
| 17 RUN_TEST(InitialState); | 17 RUN_TEST(InitialState, filter); |
| 18 RUN_TEST(SingleInvalidation); | 18 RUN_TEST(SingleInvalidation, filter); |
| 19 RUN_TEST(DoubleDisjointInvalidation); | 19 RUN_TEST(DoubleDisjointInvalidation, filter); |
| 20 RUN_TEST(SingleScroll); | 20 RUN_TEST(SingleScroll, filter); |
| 21 RUN_TEST(DoubleOverlappingScroll); | 21 RUN_TEST(DoubleOverlappingScroll, filter); |
| 22 RUN_TEST(NegatingScroll); | 22 RUN_TEST(NegatingScroll, filter); |
| 23 RUN_TEST(DiagonalScroll); | 23 RUN_TEST(DiagonalScroll, filter); |
| 24 RUN_TEST(ContainedPaintAfterScroll); | 24 RUN_TEST(ContainedPaintAfterScroll, filter); |
| 25 RUN_TEST(ContainedPaintBeforeScroll); | 25 RUN_TEST(ContainedPaintBeforeScroll, filter); |
| 26 RUN_TEST(ContainedPaintsBeforeAndAfterScroll); | 26 RUN_TEST(ContainedPaintsBeforeAndAfterScroll, filter); |
| 27 RUN_TEST(LargeContainedPaintAfterScroll); | 27 RUN_TEST(LargeContainedPaintAfterScroll, filter); |
| 28 RUN_TEST(LargeContainedPaintBeforeScroll); | 28 RUN_TEST(LargeContainedPaintBeforeScroll, filter); |
| 29 RUN_TEST(OverlappingPaintBeforeScroll); | 29 RUN_TEST(OverlappingPaintBeforeScroll, filter); |
| 30 RUN_TEST(OverlappingPaintAfterScroll); | 30 RUN_TEST(OverlappingPaintAfterScroll, filter); |
| 31 RUN_TEST(DisjointPaintBeforeScroll); | 31 RUN_TEST(DisjointPaintBeforeScroll, filter); |
| 32 RUN_TEST(DisjointPaintAfterScroll); | 32 RUN_TEST(DisjointPaintAfterScroll, filter); |
| 33 RUN_TEST(ContainedPaintTrimmedByScroll); | 33 RUN_TEST(ContainedPaintTrimmedByScroll, filter); |
| 34 RUN_TEST(ContainedPaintEliminatedByScroll); | 34 RUN_TEST(ContainedPaintEliminatedByScroll, filter); |
| 35 RUN_TEST(ContainedPaintAfterScrollTrimmedByScrollDamage); | 35 RUN_TEST(ContainedPaintAfterScrollTrimmedByScrollDamage, filter); |
| 36 RUN_TEST(ContainedPaintAfterScrollEliminatedByScrollDamage); | 36 RUN_TEST(ContainedPaintAfterScrollEliminatedByScrollDamage, filter); |
| 37 } | 37 } |
| 38 | 38 |
| 39 std::string TestPaintAggregator::TestInitialState() { | 39 std::string TestPaintAggregator::TestInitialState() { |
| 40 pp::PaintAggregator greg; | 40 pp::PaintAggregator greg; |
| 41 if (greg.HasPendingUpdate()) | 41 if (greg.HasPendingUpdate()) |
| 42 return "Pending update invalid"; | 42 return "Pending update invalid"; |
| 43 PASS(); | 43 PASS(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 std::string TestPaintAggregator::TestSingleInvalidation() { | 46 std::string TestPaintAggregator::TestSingleInvalidation() { |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 | 417 |
| 418 ASSERT_TRUE(greg.HasPendingUpdate()); | 418 ASSERT_TRUE(greg.HasPendingUpdate()); |
| 419 | 419 |
| 420 ASSERT_FALSE(greg.GetPendingUpdate().scroll_rect.IsEmpty()); | 420 ASSERT_FALSE(greg.GetPendingUpdate().scroll_rect.IsEmpty()); |
| 421 ASSERT_TRUE(1U == greg.GetPendingUpdate().paint_rects.size()); | 421 ASSERT_TRUE(1U == greg.GetPendingUpdate().paint_rects.size()); |
| 422 | 422 |
| 423 ASSERT_TRUE(scroll_rect == greg.GetPendingUpdate().scroll_rect); | 423 ASSERT_TRUE(scroll_rect == greg.GetPendingUpdate().scroll_rect); |
| 424 ASSERT_TRUE(expected_scroll_damage == greg.GetPendingUpdate().paint_rects[0]); | 424 ASSERT_TRUE(expected_scroll_damage == greg.GetPendingUpdate().paint_rects[0]); |
| 425 PASS(); | 425 PASS(); |
| 426 } | 426 } |
| OLD | NEW |