mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 970251 - Part 3: Marionette tests. r=dimi
This commit is contained in:
parent
81aaa2bb6b
commit
e214d09d1c
@ -4,20 +4,53 @@
|
|||||||
MARIONETTE_TIMEOUT = 30000;
|
MARIONETTE_TIMEOUT = 30000;
|
||||||
MARIONETTE_HEAD_JS = 'head.js';
|
MARIONETTE_HEAD_JS = 'head.js';
|
||||||
|
|
||||||
|
let nfc = window.navigator.mozNfc;
|
||||||
function testEnableNFC() {
|
function testEnableNFC() {
|
||||||
log('Running \'testEnableNFC\'');
|
log('Running \'testEnableNFC\'');
|
||||||
toggleNFC(true, runNextTest);
|
let req = nfc.startPoll();
|
||||||
|
req.onsuccess = function () {
|
||||||
|
ok(true);
|
||||||
|
runNextTest();
|
||||||
|
};
|
||||||
|
req.onerror = function () {
|
||||||
|
ok(false, "startPoll failed");
|
||||||
|
runNextTest();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function testDisableNFC() {
|
function testDisableNFC() {
|
||||||
log('Running \'testDisableNFC\'');
|
log('Running \'testDisableNFC\'');
|
||||||
toggleNFC(false, runNextTest);
|
let req = nfc.powerOff();
|
||||||
|
req.onsuccess = function () {
|
||||||
|
ok(true);
|
||||||
|
runNextTest();
|
||||||
|
};
|
||||||
|
req.onerror = function () {
|
||||||
|
ok(false, "powerOff failed");
|
||||||
|
runNextTest();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function testStopPollNFC() {
|
||||||
|
log('Running \'testStopPollNFC\'');
|
||||||
|
let req = nfc.stopPoll();
|
||||||
|
req.onsuccess = function () {
|
||||||
|
ok(true);
|
||||||
|
runNextTest();
|
||||||
|
};
|
||||||
|
req.onerror = function () {
|
||||||
|
ok(false, "stopPoll failed");
|
||||||
|
runNextTest();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
let tests = [
|
let tests = [
|
||||||
testEnableNFC,
|
testEnableNFC,
|
||||||
|
testStopPollNFC,
|
||||||
testDisableNFC
|
testDisableNFC
|
||||||
];
|
];
|
||||||
|
|
||||||
SpecialPowers.pushPermissions(
|
SpecialPowers.pushPermissions(
|
||||||
[{'type': 'settings', 'allow': true, 'context': document}], runTests);
|
[{'type': 'settings', 'allow': true, 'context': document},
|
||||||
|
{'type': 'nfc-manager', 'allow': true, 'context': document}],
|
||||||
|
runTests);
|
||||||
|
Loading…
Reference in New Issue
Block a user