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

Unified Diff: third_party/WebKit/Source/core/frame/FrameViewTest.cpp

Issue 2222693002: Dismiss tooltip on all scrolls, not just frame scrolls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@rls-enable
Patch Set: Created 4 years, 4 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 | « no previous file | third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/FrameViewTest.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameViewTest.cpp b/third_party/WebKit/Source/core/frame/FrameViewTest.cpp
index f5677254f6067655519c6e72679ed180e37dd41a..5438ffa3f6faa0fd4d4b988dacfb5034e893a72a 100644
--- a/third_party/WebKit/Source/core/frame/FrameViewTest.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameViewTest.cpp
@@ -38,7 +38,9 @@ public:
bool m_hasScheduledAnimation;
};
-class FrameViewTestBase : public testing::Test {
+class FrameViewTestBase
+ : public testing::Test
+ , public testing::WithParamInterface<FrameSettingOverrideFunction> {
protected:
FrameViewTestBase()
: m_chromeClient(new MockChromeClient)
@@ -56,6 +58,8 @@ protected:
clients.chromeClient = m_chromeClient.get();
m_pageHolder = DummyPageHolder::create(IntSize(800, 600), &clients);
m_pageHolder->page().settings().setAcceleratedCompositingEnabled(true);
+ if (GetParam())
+ (*GetParam())(m_pageHolder->page().settings());
}
Document& document() { return m_pageHolder->document(); }
@@ -100,17 +104,25 @@ private:
RuntimeEnabledFeatures::Backup m_featuresBackup;
};
+INSTANTIATE_TEST_CASE_P(All, FrameViewTest, ::testing::Values(
+ nullptr,
+ &RootLayerScrollsFrameSettingOverride));
+
+INSTANTIATE_TEST_CASE_P(All, FrameViewSlimmingPaintV2Test, ::testing::Values(
+ nullptr,
+ &RootLayerScrollsFrameSettingOverride));
tdresser 2016/08/08 13:15:44 Aren't these two instantiations identical?
szager1 2016/08/08 18:12:34 No, the first one ("nullptr") will not apply any o
tdresser 2016/08/08 18:21:28 Whoops, sorry, I was forgetting how INSTANTIATE_TE
+
// These tests ensure that FrameView informs the ChromeClient of changes to the
// paint artifact so that they can be shown to the user (e.g. via the
// compositor).
-TEST_F(FrameViewSlimmingPaintV2Test, PaintOnce)
+TEST_P(FrameViewSlimmingPaintV2Test, PaintOnce)
{
EXPECT_CALL(chromeClient(), didPaint(_));
document().body()->setInnerHTML("Hello world", ASSERT_NO_EXCEPTION);
document().view()->updateAllLifecyclePhases();
}
-TEST_F(FrameViewSlimmingPaintV2Test, PaintAndRepaint)
+TEST_P(FrameViewSlimmingPaintV2Test, PaintAndRepaint)
{
EXPECT_CALL(chromeClient(), didPaint(_)).Times(2);
document().body()->setInnerHTML("Hello", ASSERT_NO_EXCEPTION);
@@ -119,7 +131,7 @@ TEST_F(FrameViewSlimmingPaintV2Test, PaintAndRepaint)
document().view()->updateAllLifecyclePhases();
}
-TEST_F(FrameViewTest, SetPaintInvalidationDuringUpdateAllLifecyclePhases)
+TEST_P(FrameViewTest, SetPaintInvalidationDuringUpdateAllLifecyclePhases)
{
document().body()->setInnerHTML("<div id='a' style='color: blue'>A</div>", ASSERT_NO_EXCEPTION);
document().view()->updateAllLifecyclePhases();
@@ -129,7 +141,7 @@ TEST_F(FrameViewTest, SetPaintInvalidationDuringUpdateAllLifecyclePhases)
EXPECT_FALSE(chromeClient().m_hasScheduledAnimation);
}
-TEST_F(FrameViewTest, SetPaintInvalidationOutOfUpdateAllLifecyclePhases)
+TEST_P(FrameViewTest, SetPaintInvalidationOutOfUpdateAllLifecyclePhases)
{
document().body()->setInnerHTML("<div id='a' style='color: blue'>A</div>", ASSERT_NO_EXCEPTION);
document().view()->updateAllLifecyclePhases();
@@ -146,13 +158,13 @@ TEST_F(FrameViewTest, SetPaintInvalidationOutOfUpdateAllLifecyclePhases)
// If we don't hide the tooltip on scroll, it can negatively impact scrolling
// performance. See crbug.com/586852 for details.
-TEST_F(FrameViewTest, HideTooltipWhenScrollPositionChanges)
+TEST_P(FrameViewTest, HideTooltipWhenScrollPositionChanges)
{
document().body()->setInnerHTML("<div style='width:1000px;height:1000px'></div>", ASSERT_NO_EXCEPTION);
document().view()->updateAllLifecyclePhases();
EXPECT_CALL(chromeClient(), setToolTip(String(), _));
- document().view()->setScrollPosition(DoublePoint(1, 1), UserScroll);
+ document().view()->layoutViewportScrollableArea()->setScrollPosition(DoublePoint(1, 1), UserScroll);
}
} // namespace
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698