OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 import os | 4 import os |
5 | 5 |
6 from telemetry.page import Page | 6 from telemetry.page import Page |
7 from telemetry import scrolling_action | 7 from telemetry import scrolling_action |
8 from telemetry import tab_test_case | 8 from telemetry import tab_test_case |
9 | 9 |
10 class ScrollingActionTest(tab_test_case.TabTestCase): | 10 class ScrollingActionTest(tab_test_case.TabTestCase): |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 __ScrollingAction_GetBoundingVisibleRect(document.body).top + | 82 __ScrollingAction_GetBoundingVisibleRect(document.body).top + |
83 __ScrollingAction_GetBoundingVisibleRect(document.body).height""")) | 83 __ScrollingAction_GetBoundingVisibleRect(document.body).height""")) |
84 rect_right = int(self._tab.EvaluateJavaScript(""" | 84 rect_right = int(self._tab.EvaluateJavaScript(""" |
85 __ScrollingAction_GetBoundingVisibleRect(document.body).left + | 85 __ScrollingAction_GetBoundingVisibleRect(document.body).left + |
86 __ScrollingAction_GetBoundingVisibleRect(document.body).width""")) | 86 __ScrollingAction_GetBoundingVisibleRect(document.body).width""")) |
87 viewport_width = int(self._tab.EvaluateJavaScript('window.innerWidth')) | 87 viewport_width = int(self._tab.EvaluateJavaScript('window.innerWidth')) |
88 viewport_height = int(self._tab.EvaluateJavaScript('window.innerHeight')) | 88 viewport_height = int(self._tab.EvaluateJavaScript('window.innerHeight')) |
89 | 89 |
90 self.assertTrue(rect_bottom <= viewport_height) | 90 self.assertTrue(rect_bottom <= viewport_height) |
91 self.assertTrue(rect_right <= viewport_width) | 91 self.assertTrue(rect_right <= viewport_width) |
OLD | NEW |