зеркало из https://github.com/mozilla/gecko-dev.git
Bug 960510 - Part 2: marionette test for MozNDEFRecord. r=dimi, kyle
This commit is contained in:
Родитель
28cc482bb8
Коммит
37a87bf5c7
|
@ -3,5 +3,6 @@ b2g=true
|
|||
browser=false
|
||||
qemu=true
|
||||
|
||||
[test_ndef.js]
|
||||
[test_nfc_enabled.js]
|
||||
[test_nfc_manager_tech_discovered.js]
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
MARIONETTE_TIMEOUT = 30000;
|
||||
MARIONETTE_HEAD_JS = 'head.js';
|
||||
|
||||
function testConstructNDEF() {
|
||||
try {
|
||||
// omit type, id and payload.
|
||||
let r = new MozNDEFRecord(0x0);
|
||||
is(r.type, null, "r.type should be null")
|
||||
is(r.id, null, "r.id should be null")
|
||||
is(r.payload, null, "r.payload should be null")
|
||||
|
||||
// omit id and payload.
|
||||
r = new MozNDEFRecord(0x0, new Uint8Array());
|
||||
is(r.id, null, "r.id should be null")
|
||||
is(r.payload, null, "r.payload should be null")
|
||||
|
||||
// omit payload.
|
||||
r = new MozNDEFRecord(0x0, new Uint8Array(), new Uint8Array());
|
||||
is(r.payload, null, "r.payload should be null")
|
||||
|
||||
ok(true);
|
||||
} catch (e) {
|
||||
ok(false, 'type, id or payload should be optional. error:' + e);
|
||||
}
|
||||
|
||||
runNextTest();
|
||||
}
|
||||
|
||||
let tests = [
|
||||
testConstructNDEF
|
||||
];
|
||||
|
||||
SpecialPowers.pushPermissions(
|
||||
[{'type': 'settings', 'allow': true, 'context': document}], runTests);
|
Загрузка…
Ссылка в новой задаче