mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Update web-platform-tests to revision cfada7e6cb379699fa94c7ed8fcb97082327e10c
This commit is contained in:
parent
87e7e3d429
commit
06b00da16b
179 changed files with 6103 additions and 1186 deletions
40
tests/wpt/web-platform-tests/web-nfc/NFCReader.https.html
Normal file
40
tests/wpt/web-platform-tests/web-nfc/NFCReader.https.html
Normal file
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>Web NFC: NFCReader tests</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com"/>
|
||||
<link rel="help" href="https://w3c.github.io/web-nfc/"/>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<div id="log"></div>
|
||||
|
||||
<script>
|
||||
|
||||
"use strict";
|
||||
|
||||
function waitSyntaxErrorPromise(t, reader) {
|
||||
const readerWatcher = new EventWatcher(t, reader, ["reading", "error"]);
|
||||
const promise = readerWatcher.wait_for("error").then(event => {
|
||||
assert_equals(event.error.name, 'SyntaxError');
|
||||
});
|
||||
// NFCReader#start() synchronously dispatches the syntax error event.
|
||||
reader.start();
|
||||
return promise;
|
||||
}
|
||||
|
||||
promise_test(t => {
|
||||
const reader = new NFCReader({url: "www.a.com"});
|
||||
return waitSyntaxErrorPromise(t, reader);
|
||||
}, 'Test that NFCReader.start fails if NFCReaderOptions.url is missing components.');
|
||||
|
||||
promise_test(t => {
|
||||
const reader = new NFCReader({url: "invalid"});
|
||||
return waitSyntaxErrorPromise(t, reader);
|
||||
}, 'Test that NFCReader.start fails if NFCReaderOptions.url is invalid.');
|
||||
|
||||
promise_test(t => {
|
||||
const reader = new NFCReader({url: "http://a.com"});
|
||||
return waitSyntaxErrorPromise(t, reader);
|
||||
}, 'Test that NFCReader.start fails if NFCReaderOptions.url has wrong protocol.');
|
||||
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue