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

Issue 714034 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] It should throw TypeError when passing undefined to nfc.push

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: Test that passing undefined to nfc.push would raise TypeError.

1.Set the type of the message parameter is not DOMString or ArrayBuffer, 
  e.g.: navigator.nfc.push(undefined)

What is the expected behavior?
TypeError is thrown.

What went wrong?
TypeMismatchError is 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: 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 the type of the message parameter is not DOMString or ArrayBuffer, and it is not an instance of NFCMessage, reject promise with "TypeError", 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)
canx.cao@ Could you make an issue for the spec? If passed parameter is of unexpected type, TypeError should be thrown. I can align implementation and throw TypeError instead of TypeMismatchError.
Components: Blink>NFC
Created spec issue https://github.com/w3c/web-nfc/pull/111
Status: Started (was: Assigned)
Summary: [webnfc] It should throw TypeError when passing undefined to nfc.push (was: [webnfc] It should throw SyntaxError when passing undefined to nfc.push)
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/+/5f758d2372e693f69e1f3b1da495d95e5434e07f

commit 5f758d2372e693f69e1f3b1da495d95e5434e07f
Author: alexander.shalamov <alexander.shalamov@intel.com>
Date: Wed Apr 26 07:06:10 2017

[webnfc] Nfc.push method must reject promise with TypeError

According to latest changes in specification [1,2], when argument
of invalid type is provided to nfc.push function, promise must be
rejected with TypeError, instead of SyntaxError.

[1] https://w3c.github.io/web-nfc/#dom-nfc-push
[2] https://github.com/w3c/web-nfc/issues/110

BUG= 714034 

Review-Url: https://codereview.chromium.org/2836063004
Cr-Commit-Position: refs/heads/master@{#467258}

[modify] https://crrev.com/5f758d2372e693f69e1f3b1da495d95e5434e07f/third_party/WebKit/LayoutTests/nfc/push.html
[modify] https://crrev.com/5f758d2372e693f69e1f3b1da495d95e5434e07f/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