michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: MARIONETTE_TIMEOUT = 30000; michael@0: MARIONETTE_HEAD_JS = 'head.js'; michael@0: michael@0: function testConstructNDEF() { michael@0: try { michael@0: // omit type, id and payload. michael@0: let r = new MozNDEFRecord(0x0); michael@0: is(r.type, null, "r.type should be null") michael@0: is(r.id, null, "r.id should be null") michael@0: is(r.payload, null, "r.payload should be null") michael@0: michael@0: // omit id and payload. michael@0: r = new MozNDEFRecord(0x0, new Uint8Array()); michael@0: is(r.id, null, "r.id should be null") michael@0: is(r.payload, null, "r.payload should be null") michael@0: michael@0: // omit payload. michael@0: r = new MozNDEFRecord(0x0, new Uint8Array(), new Uint8Array()); michael@0: is(r.payload, null, "r.payload should be null") michael@0: michael@0: ok(true); michael@0: } catch (e) { michael@0: ok(false, 'type, id or payload should be optional. error:' + e); michael@0: } michael@0: michael@0: runNextTest(); michael@0: } michael@0: michael@0: let tests = [ michael@0: testConstructNDEF michael@0: ]; michael@0: michael@0: runTests();