New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 714035 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Email to this user bounced
Closed: Apr 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug


Show other hotlists

Hotlists containing this issue:
NFC


Sign in to add a comment

[webnfc] nfc.push should throw TypeError when timeout value is invalid

Reported by canx....@intel.com, Apr 21 2017

Issue description

Steps 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.
 

Comment 1 by canx....@intel.com, Apr 21 2017

Cc: wanming.lin@intel.com , alexander.shalamov@intel.com 
Please take a look. Thanks.
Owner: alexande...@intel.com
Status: Assigned (was: Unconfirmed)
Status: WontFix (was: Assigned)
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
Status: Unconfirmed (was: WontFix)
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.
Components: Blink>NFC
Status: Started (was: Unconfirmed)
Created spec issue https://github.com/w3c/web-nfc/issues/112
Summary: [webnfc] nfc.push should throw TypeError when timeout value is invalid (was: [webnfc] nfc.push should throw SyntaxError when timeout value is invalid)
Fixed the spec.
Description: Show this description
Project Member

Comment 9 by bugdroid1@chromium.org, 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

Status: Fixed (was: Started)
QA test this issue with Chrome 60.0.3087.3, it has been fixed.
Close.
Status: Verified (was: Fixed)

Sign in to add a comment