--- a/mobile/chrome/tests/browser_tapping.js
+++ b/mobile/chrome/tests/browser_tapping.js
@@ -139,17 +139,17 @@ gTests.push({
run: function() {
let inputHandler = gCurrentTab.browser.parentNode;
let width = inputHandler.getBoundingClientRect().width;
let height = inputHandler.getBoundingClientRect().height;
// Should fire "TapSingle"
info("Test good single tap");
clearEvents();
- EventUtils.synthesizeMouse(inputHandler, width / 2, height / 2, {});
+ EventUtils.synthesizeMouse(document.documentElement, width / 2, height / 2, {});
// We wait a bit because of the delay allowed for double clicking on device
// where it is not native
setTimeout(function() {
ok(checkEvents(["TapSingle"]), "Fired a good single tap");
clearEvents();
gCurrentTest.doubleTapTest();
}, kDoubleClickIntervalPlus);
@@ -158,18 +158,18 @@ gTests.push({
doubleTapTest: function() {
let inputHandler = gCurrentTab.browser.parentNode;
let width = inputHandler.getBoundingClientRect().width;
let height = inputHandler.getBoundingClientRect().height;
// Should fire "TapDouble"
info("Test good double tap");
clearEvents();
- EventUtils.synthesizeMouse(inputHandler, width / 2, height / 2, {});
- EventUtils.synthesizeMouse(inputHandler, width / 2, height / 2, {});
+ EventUtils.synthesizeMouse(document.documentElement, width / 2, height / 2, {});
+ EventUtils.synthesizeMouse(document.documentElement, width / 2, height / 2, {});
setTimeout(function() {
ok(checkEvents(["TapDouble"]), "Fired a good double tap");
clearEvents();
gCurrentTest.doubleTapFailTest();
}, kDoubleClickIntervalPlus);
},
@@ -177,54 +177,54 @@ gTests.push({
doubleTapFailTest: function() {
let inputHandler = gCurrentTab.browser.parentNode;
let width = inputHandler.getBoundingClientRect().width;
let height = inputHandler.getBoundingClientRect().height;
// Should fire "TapSingle", "TapSingle"
info("Test two single taps in different locations");
clearEvents();
- EventUtils.synthesizeMouse(inputHandler, width / 3, height / 3, {});
- EventUtils.synthesizeMouse(inputHandler, width * 2 / 3, height * 2 / 3, {});
+ EventUtils.synthesizeMouse(document.documentElement, width / 3, height / 3, {});
+ EventUtils.synthesizeMouse(document.documentElement, width * 2 / 3, height * 2 / 3, {});
setTimeout(function() {
ok(checkEvents(["TapSingle", "TapSingle"]), "Fired two single taps in different places, not a double tap");
clearEvents();
gCurrentTest.tapPanTest();
}, 500);
},
tapPanTest: function() {
let inputHandler = gCurrentTab.browser.parentNode;
let width = inputHandler.getBoundingClientRect().width;
let height = inputHandler.getBoundingClientRect().height;
info("Test a pan - non-tap event");
clearEvents();
- EventUtils.synthesizeMouse(inputHandler, width / 2, height / 3, { type: "mousedown" });
- EventUtils.synthesizeMouse(inputHandler, width / 2, height * 2 / 3, { type: "mousemove" });
- EventUtils.synthesizeMouse(inputHandler, width / 2, height * 2 / 3, { type: "mouseup" });
+ EventUtils.synthesizeMouse(document.documentElement, width / 2, height / 3, { type: "mousedown" });
+ EventUtils.synthesizeMouse(document.documentElement, width / 2, height * 2 / 3, { type: "mousemove" });
+ EventUtils.synthesizeMouse(document.documentElement, width / 2, height * 2 / 3, { type: "mouseup" });
ok(checkEvents([]), "Fired a pan which should be seen as a non event");
clearEvents();
setTimeout(function() { gCurrentTest.longTapFailTest(); }, 500);
},
longTapFailTest: function() {
let inputHandler = gCurrentTab.browser.parentNode;
let width = inputHandler.getBoundingClientRect().width;
let height = inputHandler.getBoundingClientRect().height;
info("Test a long pan - non-tap event");
clearEvents();
- EventUtils.synthesizeMouse(inputHandler, width / 2, height / 3, { type: "mousedown" });
- EventUtils.synthesizeMouse(inputHandler, width / 2, height * 2 / 3, { type: "mousemove" });
+ EventUtils.synthesizeMouse(document.documentElement, width / 2, height / 3, { type: "mousedown" });
+ EventUtils.synthesizeMouse(document.documentElement, width / 2, height * 2 / 3, { type: "mousemove" });
setTimeout(function() {
- EventUtils.synthesizeMouse(inputHandler, width / 2, height * 2 / 3, { type: "mouseup" });
+ EventUtils.synthesizeMouse(document.documentElement, width / 2, height * 2 / 3, { type: "mouseup" });
ok(checkEvents([]), "Fired a pan + delay which should be seen as a non-event");
clearEvents();
window.addEventListener("PanFinished", function() {
setTimeout(gCurrentTest.longTapPassTest, 0);
}, true);
}, 500);
},
@@ -232,29 +232,29 @@ gTests.push({
longTapPassTest: function() {
let browser = gCurrentTab.browser;
let inputHandler = browser.parentNode;
let width = inputHandler.getBoundingClientRect().width;
let height = inputHandler.getBoundingClientRect().height;
window.addEventListener("TapLong", function() {
window.removeEventListener("TapLong", arguments.callee, true);
- EventUtils.synthesizeMouse(inputHandler, width / 2, height / 2, { type: "mouseup" });
+ EventUtils.synthesizeMouse(document.documentElement, width / 2, height / 2, { type: "mouseup" });
ok(checkEvents(["TapLong"]), "Fired a good long tap");
clearEvents();
}, true);
browser.messageManager.addMessageListener("Browser:ContextMenu", function(aMessage) {
browser.messageManager.removeMessageListener(aMessage.name, arguments.callee);
setTimeout(gCurrentTest.contextPlainLinkTest, 0);
});
info("Test a good long pan");
clearEvents();
- EventUtils.synthesizeMouse(inputHandler, width / 2, height / 2, { type: "mousedown" });
+ EventUtils.synthesizeMouse(document.documentElement, width / 2, height / 2, { type: "mousedown" });
},
contextPlainLinkTest: function() {
waitForContextMenu(function(aJSON) {
is(aJSON.linkTitle, "A blank page - nothing interesting", "Text content should be the content of the second link");
ok(checkContextTypes(["link", "link-saveable","link-openable"]), "Plain link context types");
}, gCurrentTest.contextPlainImageTest);