[webnfc] nfc.push should throw TypeError when timeout value is invalid
Reported by
canx....@intel.com,
Apr 21 2017
|
|||||||||
Issue descriptionSteps to reproduce the problem: Test case: https://thewebera.github.io/web-test-suite/web-nfc/nfc/nfc_push_exceptions.https.html Test name: nfc.push should fail with TypeError when timeout value is invalid. 1.Set the invalid timeout value, e.g. navigator.nfc.push(“test”, { timeout: "invalid"}) What is the expected behavior? Test should fail with TypeError. What went wrong? No error thrown. Did this work before? N/A Does this work in other browsers? N/A Chrome version: 60.0.3074.0 Channel: canary OS Version: Nexus 7 (Android 5.1) Flash Version: Shockwave Flash 25.0 r0 According to the spec: https://w3c.github.io/web-nfc/#the-push-method Description: If timeout value is not valid or it is not supported by the UA, reject promise with "SyntaxError" and abort these steps.
,
Apr 21 2017
,
Apr 21 2017
canx.cao@ There is a type mismatch for 'convert to idl value' operation, therefore, timeout value is not set. No error should be thrown. https://heycam.github.io/webidl/#es-unrestricted-double
,
Apr 21 2017
canx.cao@ Maybe better to align WebNFC spec with web idl type conversion. 1. Remove 'is not valid or it' 2. If not supported by UA, throw NotSupportedError instead of SyntaxError.
,
Apr 21 2017
,
Apr 24 2017
,
Apr 25 2017
Fixed the spec.
,
Apr 25 2017
,
Apr 26 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d5514f4cd0a146298f52a96ac5f75b58f95b2980 commit d5514f4cd0a146298f52a96ac5f75b58f95b2980 Author: alexander.shalamov <alexander.shalamov@intel.com> Date: Wed Apr 26 08:20:09 2017 [webnfc] Reject promise if passed timeout value is invalid According to latest changes in specification [1,2], when invalid NFCPushOptions.timeout is provided to nfc.push function, promise must be rejected with TypeError. [1] https://w3c.github.io/web-nfc/#dom-nfc-push [2] https://github.com/w3c/web-nfc/issues/112 BUG= 714035 Review-Url: https://codereview.chromium.org/2836813007 Cr-Commit-Position: refs/heads/master@{#467265} [modify] https://crrev.com/d5514f4cd0a146298f52a96ac5f75b58f95b2980/third_party/WebKit/LayoutTests/nfc/push.html [modify] https://crrev.com/d5514f4cd0a146298f52a96ac5f75b58f95b2980/third_party/WebKit/Source/modules/nfc/NFC.cpp
,
Apr 26 2017
,
May 4 2017
QA test this issue with Chrome 60.0.3087.3, it has been fixed. Close.
,
May 4 2017
|
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by canx....@intel.com
, Apr 21 2017