| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/paint/NinePieceImageGrid.h" | 5 #include "core/paint/NinePieceImageGrid.h" |
| 6 | 6 |
| 7 #include "core/css/CSSGradientValue.h" | 7 #include "core/css/CSSGradientValue.h" |
| 8 #include "core/layout/LayoutTestHelper.h" | 8 #include "core/layout/LayoutTestHelper.h" |
| 9 #include "core/style/ComputedStyle.h" | 9 #include "core/style/ComputedStyle.h" |
| 10 #include "core/style/NinePieceImage.h" | 10 #include "core/style/NinePieceImage.h" |
| 11 #include "core/style/StyleGeneratedImage.h" | 11 #include "core/style/StyleGeneratedImage.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 class NinePieceImageGridTest : public RenderingTest { | 17 class NinePieceImageGridTest : public RenderingTest { |
| 18 public: | 18 public: |
| 19 NinePieceImageGridTest() {} | 19 NinePieceImageGridTest() {} |
| 20 | 20 |
| 21 StyleImage* GeneratedImage() { | 21 StyleImage* GeneratedImage() { |
| 22 CSSLinearGradientValue* gradient = | 22 CSSGradientValue* gradient = CSSLinearGradientValue::Create( |
| 23 CSSLinearGradientValue::Create(kRepeating); | 23 nullptr, nullptr, nullptr, nullptr, nullptr, kRepeating); |
| 24 return StyleGeneratedImage::Create(*gradient); | 24 return StyleGeneratedImage::Create(*gradient); |
| 25 } | 25 } |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 void SetUp() override { RenderingTest::SetUp(); } | 28 void SetUp() override { RenderingTest::SetUp(); } |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 TEST_F(NinePieceImageGridTest, NinePieceImagePainting_NoDrawables) { | 31 TEST_F(NinePieceImageGridTest, NinePieceImagePainting_NoDrawables) { |
| 32 NinePieceImage nine_piece; | 32 NinePieceImage nine_piece; |
| 33 nine_piece.SetImage(GeneratedImage()); | 33 nine_piece.SetImage(GeneratedImage()); |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 EXPECT_EQ(test_case.pieces[piece].horizontal_rule, | 354 EXPECT_EQ(test_case.pieces[piece].horizontal_rule, |
| 355 draw_info.tile_rule.horizontal); | 355 draw_info.tile_rule.horizontal); |
| 356 EXPECT_EQ(test_case.pieces[piece].vertical_rule, | 356 EXPECT_EQ(test_case.pieces[piece].vertical_rule, |
| 357 draw_info.tile_rule.vertical); | 357 draw_info.tile_rule.vertical); |
| 358 } | 358 } |
| 359 } | 359 } |
| 360 } | 360 } |
| 361 | 361 |
| 362 } // namespace | 362 } // namespace |
| 363 } // namespace blink | 363 } // namespace blink |
| OLD | NEW |