Update web-platform-tests to revision e3d0146264093a389148cc555ee9be69bd75719b

This commit is contained in:
WPT Sync Bot 2019-04-10 21:49:30 -04:00
parent dd2deeabca
commit 7e807a0d1e
37 changed files with 842 additions and 140 deletions

View file

@ -6,6 +6,7 @@
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/nfc_help.js"></script>
<meta name="flags" content="interact">
<p>Tap an NFC tag to the test device with NFC support.</p>
@ -20,25 +21,14 @@
setup({ explicit_timeout: true });
promise_test(async t => {
const writer = new NFCWriter();
const reader1 = new NFCReader({url: `${location.origin}/custom/invalid`});
const reader2 = new NFCReader({url: `${location.origin}/custom/path`});
await writer.push({
url: "/custom/path/update",
records: [{ recordType: "text", data: "valid" }]
});
const desc = "Test that the url of NFCReaderOptions filters relevant data sources correctly.";
const readOptions = {url: `${location.origin}/custom/path`};
const unacceptableReadOptions = {url: `${location.origin}/custom/invalid`};
const message = {
url: "/custom/path/update",
records: [createTextRecord(test_text_data)]
}
reader1.onreading = t.unreached_func("reading event should not be fired.");
reader1.start();
const readerWatcher = new EventWatcher(t, reader2, ["reading", "error"]);
reader2.start();
const event = await readerWatcher.wait_for("reading");
const message = event.message;
assert_equals(message.records[0].recordType, "text");
assert_equals(message.records[0].data, "valid");
assert_equals(message.url, `${location.origin}/custom/path/update`);
}, "Test that the url of NFCReaderOptions filters relevant data sources correctly.");
testNFCReaderOptions(message, readOptions, unacceptableReadOptions, desc);
</script>