Bug 1296492 Part1: Refine PE mochitest helpers to ignore the checks of synthesized pointer id. r=smaug

MozReview-Commit-ID: 5blUsJMnDfg
This commit is contained in:
Stone Shih 2017-03-03 16:52:56 +08:00
parent 1a2aee5585
commit 9e03cc7af8
2 changed files with 9 additions and 7 deletions

View File

@ -203,7 +203,7 @@ function sendTouchEvent(int_win, elemId, touchEventType, params) {
}
// Helper function to run Point Event test in a new tab.
function runTestInNewWindow(aFile) {
function runTestInNewWindow(aFile, aSuppressPointerIdCheck = false) {
var testURL = location.href.substring(0, location.href.lastIndexOf('/') + 1) + aFile;
var testWindow = window.open(testURL, "_blank");
var testDone = false;
@ -212,6 +212,7 @@ function runTestInNewWindow(aFile) {
// to the test case after DOM elements are constructed and before the load
// event is fired.
testWindow.addEventListener("DOMContentLoaded", function() {
testWindow.suppressPointerIdCheck = aSuppressPointerIdCheck;
var e = testWindow.document.createElement('script');
e.type = 'text/javascript';
e.src = "mochitest_support_internal.js";

View File

@ -69,12 +69,13 @@ function addListeners(elem) {
}[event.pointerType];
// Compare the pointerId.
resultCallback({
name: "Mismatched event.pointerId recieved.",
status: event.pointerId,
PASS: pointerId
});
if (!suppressPointerIdCheck) {
resultCallback({
name: "Mismatched event.pointerId recieved.",
status: event.pointerId,
PASS: pointerId
});
}
});
});
}