Update web-platform-tests to revision f0cb9071aea5ce5b641fcba5f362a0796bdc70bc

This commit is contained in:
WPT Sync Bot 2019-11-23 08:37:37 +00:00
parent 0d549e8146
commit 7289e837fd
558 changed files with 8627 additions and 6619 deletions

View file

@ -106,7 +106,7 @@ function assertNDEFReaderOptionsEqual(provided, received) {
// Checks whether NDEFReaderOptions are matched with given message.
function matchesWatchOptions(message, options) {
// Filter by Web NFC id.
if (!matchesWebNfcId(message.url, options.url)) return false;
if (!matchesWebNfcId(message.url, options.id)) return false;
// Matches any record / media type.
if ((options.mediaType == null || options.mediaType === '') &&
@ -298,13 +298,10 @@ var WebNFCTest = (() => {
reset() {
this.hw_status_ = NFCHWStatus.ENABLED;
this.push_completed_ = true;
this.watchers_ = [];
this.reading_messages_ = [];
this.operations_suspended_ = false;
this.cancelPendingPushOperation();
this.bindingSet_.closeAllBindings();
this.interceptor_.stop();
this.is_ndef_tech_ = true;
this.is_formatted_tag_ = false;
}
@ -389,15 +386,23 @@ var WebNFCTest = (() => {
if (testInternal.initialized)
throw new Error('Call reset() before initialize().');
testInternal.mockNFC = new MockNFC;
if (window.testRunner) {
// Grant nfc permissions for Chromium testrunner.
window.testRunner.setPermission('nfc', 'granted',
location.origin, location.origin);
}
if (testInternal.mockNFC == null) {
testInternal.mockNFC = new MockNFC();
}
testInternal.initialized = true;
}
// Resets state of nfc mocks between test runs.
// Reuses the nfc mock but resets its state between test runs.
async reset() {
if (!testInternal.initialized)
throw new Error('Call initialize() before reset().');
testInternal.mockNFC.reset();
testInternal.mockNFC = null;
testInternal.initialized = false;
await new Promise(resolve => setTimeout(resolve, 0));