Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp

Issue 2504573002: Don't call isURLAllowed() from layout. (Closed)
Patch Set: Fix bad formatting that caused clang-format-diff to get confused. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/PaintLayerClipper.h" 5 #include "core/paint/PaintLayerClipper.h"
6 6
7 #include "core/layout/LayoutBoxModelObject.h" 7 #include "core/layout/LayoutBoxModelObject.h"
8 #include "core/layout/LayoutTestHelper.h" 8 #include "core/layout/LayoutTestHelper.h"
9 #include "core/layout/LayoutView.h" 9 #include "core/layout/LayoutView.h"
10 #include "core/paint/PaintLayer.h" 10 #include "core/paint/PaintLayer.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class PaintLayerClipperTest : public RenderingTest { 14 class PaintLayerClipperTest : public RenderingTest {
15 public: 15 public:
16 PaintLayerClipperTest() 16 PaintLayerClipperTest() : RenderingTest(EmptyFrameLoaderClient::create()) {}
17 : RenderingTest(SingleChildFrameLoaderClient::create()) {}
18 }; 17 };
19 18
20 TEST_F(PaintLayerClipperTest, LayoutSVGRoot) { 19 TEST_F(PaintLayerClipperTest, LayoutSVGRoot) {
21 setBodyInnerHTML( 20 setBodyInnerHTML(
22 "<!DOCTYPE html>" 21 "<!DOCTYPE html>"
23 "<svg id=target width=200 height=300 style='position: relative'>" 22 "<svg id=target width=200 height=300 style='position: relative'>"
24 " <rect width=400 height=500 fill='blue'/>" 23 " <rect width=400 height=500 fill='blue'/>"
25 "</svg>"); 24 "</svg>");
26 25
27 Element* target = document().getElementById("target"); 26 Element* target = document().getElementById("target");
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 110
112 ClipRectsContext contextClip(layer->parent(), PaintingClipRects); 111 ClipRectsContext contextClip(layer->parent(), PaintingClipRects);
113 layer->clipper().calculateRects(contextClip, infiniteRect, layerBounds, 112 layer->clipper().calculateRects(contextClip, infiniteRect, layerBounds,
114 backgroundRect, foregroundRect); 113 backgroundRect, foregroundRect);
115 EXPECT_EQ(LayoutRect(0, 0, 200, 200), backgroundRect.rect()); 114 EXPECT_EQ(LayoutRect(0, 0, 200, 200), backgroundRect.rect());
116 EXPECT_EQ(LayoutRect(0, 0, 200, 200), foregroundRect.rect()); 115 EXPECT_EQ(LayoutRect(0, 0, 200, 200), foregroundRect.rect());
117 EXPECT_EQ(LayoutRect(0, 0, 200, 400), layerBounds); 116 EXPECT_EQ(LayoutRect(0, 0, 200, 400), layerBounds);
118 } 117 }
119 118
120 } // namespace blink 119 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698