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

Unified Diff: third_party/WebKit/Source/web/tests/RootScrollerTest.cpp

Issue 2069713002: Make all gesture scrolls use customization path internally (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + Fix test Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/page/scrolling/ViewportScrollCallback.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/RootScrollerTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp b/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp
index 94d84f83a88883dc8180cf050a7eb067970bc8a8..2f48e5cddf0a1ceb7226f01d06ddc80423a5015a 100644
--- a/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp
+++ b/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp
@@ -172,7 +172,7 @@ TEST_F(RootScrollerTest, TestDefaultRootScroller)
ASSERT_EQ(nullptr, mainFrame()->document()->rootScroller());
Element* htmlElement = mainFrame()->document()->documentElement();
- EXPECT_TRUE(mainFrame()->document()->isEffectiveRootScroller(*htmlElement));
+ EXPECT_EQ(htmlElement, mainFrame()->document()->effectiveRootScroller());
}
// Tests that setting an element as the root scroller causes it to control url
@@ -294,13 +294,13 @@ TEST_F(RootScrollerTest, TestRemoveRootScrollerFromDom)
mainFrame()->document()->setRootScroller(container, exceptionState);
ASSERT_EQ(container, mainFrame()->document()->rootScroller());
- ASSERT_TRUE(mainFrame()->document()->isEffectiveRootScroller(*container));
+ ASSERT_EQ(container, mainFrame()->document()->effectiveRootScroller());
mainFrame()->document()->body()->removeChild(container);
mainFrameView()->updateAllLifecyclePhases();
ASSERT_EQ(container, mainFrame()->document()->rootScroller());
- ASSERT_FALSE(mainFrame()->document()->isEffectiveRootScroller(*container));
+ ASSERT_NE(container, mainFrame()->document()->effectiveRootScroller());
}
// Tests that setting an element that isn't a valid scroller as the root
@@ -317,8 +317,7 @@ TEST_F(RootScrollerTest, TestSetRootScrollerOnInvalidElement)
mainFrame()->document()->setRootScroller(element, exceptionState);
mainFrameView()->updateAllLifecyclePhases();
ASSERT_EQ(element, mainFrame()->document()->rootScroller());
- ASSERT_FALSE(
- mainFrame()->document()->isEffectiveRootScroller(*element));
+ ASSERT_NE(element, mainFrame()->document()->effectiveRootScroller());
}
{
@@ -328,8 +327,7 @@ TEST_F(RootScrollerTest, TestSetRootScrollerOnInvalidElement)
mainFrame()->document()->setRootScroller(element, exceptionState);
mainFrameView()->updateAllLifecyclePhases();
ASSERT_EQ(element, mainFrame()->document()->rootScroller());
- ASSERT_FALSE(
- mainFrame()->document()->isEffectiveRootScroller(*element));
+ ASSERT_NE(element, mainFrame()->document()->effectiveRootScroller());
}
}
@@ -344,23 +342,22 @@ TEST_F(RootScrollerTest, TestRootScrollerBecomesInvalid)
TrackExceptionState exceptionState;
ASSERT_EQ(nullptr, mainFrame()->document()->rootScroller());
- ASSERT_TRUE(mainFrame()->document()->isEffectiveRootScroller(*htmlElement));
+ ASSERT_EQ(htmlElement, mainFrame()->document()->effectiveRootScroller());
{
mainFrame()->document()->setRootScroller(container, exceptionState);
mainFrameView()->updateAllLifecyclePhases();
ASSERT_EQ(container, mainFrame()->document()->rootScroller());
- ASSERT_TRUE(
- mainFrame()->document()->isEffectiveRootScroller(*container));
+ ASSERT_EQ(container, mainFrame()->document()->effectiveRootScroller());
executeScript(
"document.querySelector('#container').style.display = 'inline'");
mainFrameView()->updateAllLifecyclePhases();
ASSERT_EQ(container, mainFrame()->document()->rootScroller());
- ASSERT_TRUE(
- mainFrame()->document()->isEffectiveRootScroller(*htmlElement));
+ ASSERT_EQ(htmlElement,
+ mainFrame()->document()->effectiveRootScroller());
}
executeScript(
@@ -368,23 +365,22 @@ TEST_F(RootScrollerTest, TestRootScrollerBecomesInvalid)
mainFrame()->document()->setRootScroller(nullptr, exceptionState);
mainFrameView()->updateAllLifecyclePhases();
ASSERT_EQ(nullptr, mainFrame()->document()->rootScroller());
- ASSERT_TRUE(mainFrame()->document()->isEffectiveRootScroller(*htmlElement));
+ ASSERT_EQ(htmlElement, mainFrame()->document()->effectiveRootScroller());
{
mainFrame()->document()->setRootScroller(container, exceptionState);
mainFrameView()->updateAllLifecyclePhases();
ASSERT_EQ(container, mainFrame()->document()->rootScroller());
- ASSERT_TRUE(
- mainFrame()->document()->isEffectiveRootScroller(*container));
+ ASSERT_EQ(container, mainFrame()->document()->effectiveRootScroller());
executeScript(
"document.querySelector('#container').style.width = '98%'");
mainFrameView()->updateAllLifecyclePhases();
ASSERT_EQ(container, mainFrame()->document()->rootScroller());
- ASSERT_TRUE(
- mainFrame()->document()->isEffectiveRootScroller(*htmlElement));
+ ASSERT_EQ(htmlElement,
+ mainFrame()->document()->effectiveRootScroller());
}
}
@@ -410,8 +406,8 @@ TEST_F(RootScrollerTest, TestSetRootScrollerOnElementInIframe)
mainFrameView()->updateAllLifecyclePhases();
ASSERT_EQ(innerContainer, mainFrame()->document()->rootScroller());
- ASSERT_TRUE(
- mainFrame()->document()->isEffectiveRootScroller(*innerContainer));
+ ASSERT_EQ(innerContainer,
+ mainFrame()->document()->effectiveRootScroller());
}
{
@@ -424,8 +420,7 @@ TEST_F(RootScrollerTest, TestSetRootScrollerOnElementInIframe)
mainFrameView()->updateAllLifecyclePhases();
ASSERT_EQ(iframe, mainFrame()->document()->rootScroller());
- ASSERT_TRUE(
- mainFrame()->document()->isEffectiveRootScroller(*iframe));
+ ASSERT_EQ(iframe, mainFrame()->document()->effectiveRootScroller());
}
}
@@ -441,8 +436,8 @@ TEST_F(RootScrollerTest, TestRootScrollerWithinIframe)
HTMLFrameOwnerElement* iframe = toHTMLFrameOwnerElement(
mainFrame()->document()->getElementById("iframe"));
- ASSERT_TRUE(iframe->contentDocument()->isEffectiveRootScroller(
- *iframe->contentDocument()->documentElement()));
+ ASSERT_EQ(iframe->contentDocument()->documentElement(),
+ iframe->contentDocument()->effectiveRootScroller());
Element* innerContainer =
iframe->contentDocument()->getElementById("container");
@@ -453,8 +448,8 @@ TEST_F(RootScrollerTest, TestRootScrollerWithinIframe)
mainFrameView()->updateAllLifecyclePhases();
ASSERT_EQ(innerContainer, iframe->contentDocument()->rootScroller());
- ASSERT_TRUE(iframe->contentDocument()->isEffectiveRootScroller(
- *innerContainer));
+ ASSERT_EQ(innerContainer,
+ iframe->contentDocument()->effectiveRootScroller());
}
}
« no previous file with comments | « third_party/WebKit/Source/core/page/scrolling/ViewportScrollCallback.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698