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

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

Issue 982683003: Revert of Adding Maps page to page_sets for telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mousedrag2
Patch Set: 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 | « tools/telemetry/telemetry/page/actions/drag.py ('k') | tools/telemetry/unittest_data/draggable.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page/actions/drag_unittest.py
diff --git a/tools/telemetry/telemetry/page/actions/drag_unittest.py b/tools/telemetry/telemetry/page/actions/drag_unittest.py
deleted file mode 100644
index a1ec74fd990b1c3f6d2610435c9d1ea2c27a032e..0000000000000000000000000000000000000000
--- a/tools/telemetry/telemetry/page/actions/drag_unittest.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-import math
-import os
-
-from telemetry.page.actions import drag
-from telemetry.unittest_util import tab_test_case
-
-
-class DragActionTest(tab_test_case.TabTestCase):
- def testDragAction(self):
- self.Navigate('draggable.html')
-
- with open(os.path.join(os.path.dirname(__file__),
- 'gesture_common.js')) as f:
- js = f.read()
- self._tab.ExecuteJavaScript(js)
-
- div_width = self._tab.EvaluateJavaScript(
- '__GestureCommon_GetBoundingVisibleRect(document.body).width')
- div_height = self._tab.EvaluateJavaScript(
- '__GestureCommon_GetBoundingVisibleRect(document.body).height')
-
- i = drag.DragAction(left_start_ratio=0.5, top_start_ratio=0.5,
- left_end_ratio=0.75, top_end_ratio=0.75)
- i.WillRunAction(self._tab)
- self._tab.ExecuteJavaScript('''
- window.__dragAction.beginMeasuringHook = function() {
- window.__didBeginMeasuring = true;
- };
- window.__dragAction.endMeasuringHook = function() {
- window.__didEndMeasuring = true;
- };''')
- i.RunAction(self._tab)
-
- self.assertTrue(self._tab.EvaluateJavaScript('window.__didBeginMeasuring'))
- self.assertTrue(self._tab.EvaluateJavaScript('window.__didEndMeasuring'))
-
- div_position_x = self._tab.EvaluateJavaScript(
- 'document.getElementById("drag_div").offsetLeft')
- div_position_y = self._tab.EvaluateJavaScript(
- 'document.getElementById("drag_div").offsetTop')
-
- # 0.25 is the ratio of displacement to the initial size.
- expected_x = math.floor(div_width * -0.25)
- expected_y = math.floor(div_height * -0.25)
-
- self.assertEquals(div_position_x, expected_x,
- msg="Moved element's left coordinate: %d, expected: %d" %
- (div_position_x, expected_x))
- self.assertEquals(div_position_y, expected_y,
- msg="Moved element's top coordinate: %d, expected: %d" %
- (div_position_y, expected_y))
« no previous file with comments | « tools/telemetry/telemetry/page/actions/drag.py ('k') | tools/telemetry/unittest_data/draggable.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698