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

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

Issue 1662933003: Convert scroll anchoring flag to runtime-enabled feature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 10 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/layout/ScrollAnchor.h" 5 #include "core/layout/ScrollAnchor.h"
6 6
7 #include "core/layout/LayoutTestHelper.h" 7 #include "core/layout/LayoutTestHelper.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
11 static void enableScrollAnchoring(Settings& settings)
12 {
13 settings.setScrollAnchoringEnabled(true);
14 }
15
16 class ScrollAnchorTest : public RenderingTest { 11 class ScrollAnchorTest : public RenderingTest {
17 FrameSettingOverrideFunction settingOverrider() const override { return enab leScrollAnchoring; } 12 public:
13 ScrollAnchorTest() { RuntimeEnabledFeatures::setScrollAnchoringEnabled(true) ; }
14 ~ScrollAnchorTest() { RuntimeEnabledFeatures::setScrollAnchoringEnabled(fals e); }
18 }; 15 };
19 16
20 TEST_F(ScrollAnchorTest, Basic) 17 TEST_F(ScrollAnchorTest, Basic)
21 { 18 {
22 ScrollAnchor scrollAnchor(document().view()->layoutViewportScrollableArea()) ; 19 ScrollAnchor scrollAnchor(document().view()->layoutViewportScrollableArea()) ;
23 scrollAnchor.clear(); 20 scrollAnchor.clear();
24 EXPECT_EQ(nullptr, scrollAnchor.anchorObject()); 21 EXPECT_EQ(nullptr, scrollAnchor.anchorObject());
25 } 22 }
26 } 23 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/Settings.in ('k') | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698