Bug 917385 - Update browser_inputsource.js test. mbrubeck
authorJim Mathies <jmathies@mozilla.com>
Wed, 16 Oct 2013 12:14:59 -0500
changeset 164808 ef27681c50f7163f6f63ed3dff3332e0a56990e3
parent 164807 96905a5e44e6877e9afb5054e58d8ac25c31f051
child 164809 b0d5cef2c4271b4fd5a0c597a2f828257b0f2887
child 164857 780abea72b55d6c114a2a4ab1d51add4af853fda
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs917385
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 917385 - Update browser_inputsource.js test. mbrubeck
browser/metro/base/tests/mochitest/browser_inputsource.js
--- a/browser/metro/base/tests/mochitest/browser_inputsource.js
+++ b/browser/metro/base/tests/mochitest/browser_inputsource.js
@@ -27,49 +27,33 @@ function testState(aState) {
     ok(!StyleSheetSvc.sheetRegistered(uri, Ci.nsIStyleSheetService.AGENT_SHEET), "cursor stylesheet registered");
   } else {
     ok(!InputSourceHelper.isPrecise, "InputSourceHelper");
     let uri = Util.makeURI("chrome://browser/content/cursor.css");
     ok(StyleSheetSvc.sheetRegistered(uri, Ci.nsIStyleSheetService.AGENT_SHEET), "cursor stylesheet registered");
   }
 }
 
-function sendMouseMoves() {
-  let utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
-                      .getInterface(Components.interfaces.nsIDOMWindowUtils);
-  for (let deg = 0; deg < 180; deg++) {
-    let coord = Math.sin((deg * Math.PI)/180) * 750;
-    utils.sendMouseEventToWindow("mousemove", coord, coord, 2, 1, 0, true,
-                                  1, Ci.nsIDOMMouseEvent.MOZ_SOURCE_MOUSE);
-  }
+function notifyPrecise()
+{
+  Services.obs.notifyObservers(null, "metro_precise_input", null);
 }
 
-function sendTouchStart() {
-  EventUtils.synthesizeTouchAtPoint(100, 100, { type: "touchstart" }, window);
-}
-
-function sendTouchMove() {
-  EventUtils.synthesizeTouchAtPoint(100, 100, { type: "touchmove" }, window);
-}
-
-function sendTouchEnd() {
-  EventUtils.synthesizeTouchAtPoint(100, 100, { type: "touchend" }, window);
+function notifyImprecise()
+{
+  Services.obs.notifyObservers(null, "metro_imprecise_input", null);
 }
 
 gTests.push({
   desc: "precise/imprecise input switcher",
   setUp: setUp,
   run: function () {
-    sendMouseMoves();
+    notifyPrecise();
     testState("precise");
-    sendTouchStart();
-    testState("imprecise");
-    sendMouseMoves();
+    notifyImprecise();
     testState("imprecise");
-    sendTouchMove();
+    notifyPrecise();
+    testState("precise");
+    notifyImprecise();
     testState("imprecise");
-    sendTouchEnd();
-    testState("imprecise");
-    sendMouseMoves();
-    testState("precise");
   }
 });