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 "config.h" | 5 #include "config.h" |
6 #include "core/paint/NinePieceImageGrid.h" | 6 #include "core/paint/NinePieceImageGrid.h" |
7 | 7 |
8 #include "core/css/CSSGradientValue.h" | 8 #include "core/css/CSSGradientValue.h" |
9 #include "core/layout/LayoutTestHelper.h" | 9 #include "core/layout/LayoutTestHelper.h" |
10 #include "core/style/ComputedStyle.h" | 10 #include "core/style/ComputedStyle.h" |
11 #include "core/style/NinePieceImage.h" | 11 #include "core/style/NinePieceImage.h" |
12 #include "core/style/StyleGeneratedImage.h" | 12 #include "core/style/StyleGeneratedImage.h" |
13 #include <gtest/gtest.h> | 13 #include <gtest/gtest.h> |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 namespace { | 16 namespace { |
17 | 17 |
18 class NinePieceImageGridTest : public RenderingTest { | 18 class NinePieceImageGridTest : public RenderingTest { |
19 public: | 19 public: |
20 NinePieceImageGridTest() { } | 20 NinePieceImageGridTest() { } |
21 | 21 |
22 PassRefPtr<StyleImage> generatedImage() | 22 PassRefPtr<StyleImage> generatedImage() |
23 { | 23 { |
24 RefPtrWillBeRawPtr<CSSLinearGradientValue> gradient = CSSLinearGradientV
alue::create(Repeating); | 24 RefPtrWillBeRawPtr<CSSLinearGradientValue> gradient = CSSLinearGradientV
alue::create(Repeating); |
25 RefPtr<StyleGeneratedImage> image = StyleGeneratedImage::create(gradient
.get()); | 25 RefPtr<StyleGeneratedImage> image = StyleGeneratedImage::create(gradient
.get()); |
26 return image; | 26 return image; |
27 } | 27 } |
28 | 28 |
29 private: | 29 private: |
30 virtual void SetUp() override | 30 void SetUp() override |
31 { | 31 { |
32 RenderingTest::SetUp(); | 32 RenderingTest::SetUp(); |
33 } | 33 } |
34 }; | 34 }; |
35 | 35 |
36 TEST_F(NinePieceImageGridTest, NinePieceImagePainting_NoDrawables) | 36 TEST_F(NinePieceImageGridTest, NinePieceImagePainting_NoDrawables) |
37 { | 37 { |
38 NinePieceImage ninePiece; | 38 NinePieceImage ninePiece; |
39 ninePiece.setImage(generatedImage()); | 39 ninePiece.setImage(generatedImage()); |
40 | 40 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 EXPECT_FLOAT_EQ(testCase.pieces[piece].tileScaleHorizontal, drawInfo
.tileScale.width()); | 261 EXPECT_FLOAT_EQ(testCase.pieces[piece].tileScaleHorizontal, drawInfo
.tileScale.width()); |
262 EXPECT_FLOAT_EQ(testCase.pieces[piece].tileScaleVertical, drawInfo.t
ileScale.height()); | 262 EXPECT_FLOAT_EQ(testCase.pieces[piece].tileScaleVertical, drawInfo.t
ileScale.height()); |
263 EXPECT_EQ(testCase.pieces[piece].horizontalRule, drawInfo.tileRule.h
orizontal); | 263 EXPECT_EQ(testCase.pieces[piece].horizontalRule, drawInfo.tileRule.h
orizontal); |
264 EXPECT_EQ(testCase.pieces[piece].verticalRule, drawInfo.tileRule.ver
tical); | 264 EXPECT_EQ(testCase.pieces[piece].verticalRule, drawInfo.tileRule.ver
tical); |
265 } | 265 } |
266 } | 266 } |
267 } | 267 } |
268 | 268 |
269 } // namespace | 269 } // namespace |
270 } // namespace blink | 270 } // namespace blink |
OLD | NEW |