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

Unified Diff: tools/telemetry/telemetry/page/actions/scroll_unittest.py

Issue 976063003: Reenabling an old unit test for scrolling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Accidentally left the test checking the bottom of the viewport instead of comparing the top of the … Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page/actions/scroll_unittest.py
diff --git a/tools/telemetry/telemetry/page/actions/scroll_unittest.py b/tools/telemetry/telemetry/page/actions/scroll_unittest.py
index 85b35f1c6800194e0d0d03a4d422d7bb5c298f7e..a9b327f1fedb73fdbe474bf67a652fd5298f18b7 100644
--- a/tools/telemetry/telemetry/page/actions/scroll_unittest.py
+++ b/tools/telemetry/telemetry/page/actions/scroll_unittest.py
@@ -10,7 +10,6 @@ from telemetry.unittest_util import tab_test_case
class ScrollActionTest(tab_test_case.TabTestCase):
- @decorators.Disabled # Disabled due to flakiness: crbug.com/330544
def testScrollAction(self):
self.Navigate('blank.html')
@@ -37,15 +36,10 @@ class ScrollActionTest(tab_test_case.TabTestCase):
self.assertTrue(self._tab.EvaluateJavaScript('window.__didBeginMeasuring'))
self.assertTrue(self._tab.EvaluateJavaScript('window.__didEndMeasuring'))
- # Allow for roundoff error in scaled viewport.
scroll_position = self._tab.EvaluateJavaScript(
- """(document.documentElement.scrollTop || document.body.scrollTop)
- + window.innerHeight""")
- scroll_height = self._tab.EvaluateJavaScript('document.body.scrollHeight')
- difference = scroll_position - scroll_height
- self.assertTrue(abs(difference) <= 1,
- msg='scroll_position=%d; scroll_height=%d' %
- (scroll_position, scroll_height))
+ """(document.documentElement.scrollTop || document.body.scrollTop)""")
sullivan 2015/03/05 03:03:58 Nit: Don't need the triple quotes since this fits
+ self.assertTrue(scroll_position != 0,
+ msg='scroll_position=%d;' % (scroll_position))
def testBoundingClientRect(self):
self.Navigate('blank.html')
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698