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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutIFrameTest.cpp

Issue 2916563003: Compute effective touch action in StyleAdjuster. (Closed)
Patch Set: Add rendering test that tests iframe style change Created 3 years, 6 months 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/layout/LayoutIFrame.h"
6 #include "core/layout/LayoutTestHelper.h"
7 #include "core/layout/LayoutView.h"
8 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 namespace blink {
12
13 class LayoutIFrameTest : public RenderingTest {
14 public:
15 LayoutIFrameTest() : RenderingTest(SingleChildLocalFrameClient::Create()) {}
16 };
17
18 TEST_F(LayoutIFrameTest, TouchActionPropagatedAcrossIframes) {
flackr 2017/06/21 15:24:34 Can you make this part of StyleAdjusterTest to kee
sunxd 2017/06/22 17:22:55 Done.
19 GetDocument().SetBaseURLOverride(KURL(kParsedURLString, "http://test.com"));
20 SetBodyInnerHTML(
21 "<style>body { margin: 0; } iframe { display: block; } </style>"
22 "<iframe id='owner' src='http://test.com' width='500' height='500' "
23 "style='touch-action: none'>"
24 "</iframe>");
25 SetChildFrameHTML(
26 "<style>body { margin: 0; } #target { width: 200px; height: 200px; } "
27 "</style>"
28 "<div id='target' style='touch-action: pinch-zoom'></div>");
29 GetDocument().View()->UpdateAllLifecyclePhases();
30
31 Element* target = ChildDocument().getElementById("target");
32 ASSERT_TRUE(target && target->GetComputedStyle());
33 EXPECT_EQ(TouchAction::kTouchActionNone,
34 target->GetComputedStyle()->GetEffectiveTouchAction());
35
36 Element* owner = GetDocument().getElementById("owner");
37 ASSERT_TRUE(owner);
38 owner->setAttribute(HTMLNames::styleAttr, "touch-action: auto");
39 GetDocument().View()->UpdateAllLifecyclePhases();
40 EXPECT_EQ(TouchAction::kTouchActionPinchZoom,
41 target->GetComputedStyle()->GetEffectiveTouchAction());
42 }
43
44 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698