diff options
Diffstat (limited to 'tests/wpt/web-platform-tests/resources/chromium/nfc-mock.js')
-rw-r--r-- | tests/wpt/web-platform-tests/resources/chromium/nfc-mock.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/wpt/web-platform-tests/resources/chromium/nfc-mock.js b/tests/wpt/web-platform-tests/resources/chromium/nfc-mock.js index 01a4e70d0c9..025b1f6bfed 100644 --- a/tests/wpt/web-platform-tests/resources/chromium/nfc-mock.js +++ b/tests/wpt/web-platform-tests/resources/chromium/nfc-mock.js @@ -340,13 +340,17 @@ var WebNFCTest = (() => { setReadingMessage(message, compatibility = 'nfc-forum') { this.reading_messages_.push({message: message, compatibility: toMojoNDEFCompatibility(compatibility)}); + // Ignore reading if NFCPushOptions.ignoreRead is true + let ignoreRead = false; + if(this.push_options_ && this.push_options_.ignoreRead) + ignoreRead = this.push_options_.ignoreRead; // Triggers onWatch if the new message matches existing watchers for (let watcher of this.watchers_) { - if (matchesWatchOptions( - message, message.compatibility, watcher.options)) { + if (!ignoreRead && matchesWatchOptions( + message, toMojoNDEFCompatibility(compatibility), watcher.options)) { this.client_.onWatch( [watcher.id], fake_tag_serial_number, - toMojoNDEFMessage(message.message)); + toMojoNDEFMessage(message)); } } } |