[wpt-sync] Sync PR 20227 - [webnfc] Use one nfc mock object per test file
Categories
(Testing :: web-platform-tests, task, P4)
Tracking
(firefox72 fixed)
| Tracking | Status | |
|---|---|---|
| firefox72 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 20227 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/20227
Details from upstream follow.
Leon Han <leon.han@intel.com> wrote:
[webnfc] Use one nfc mock object per test file
Previously, each run of nfc_test() creates a new nfc mock object in the
start and destroyes it in the end.Considering a test file containing multiple nfc_test() runs, in Blink we
have just one NFCProxy instance per page context to talk to these mocks,
that means our NFCProxy gets a broken NFC Mojo connection each time the
previous nfc_test() runs to the end then has to reconnect to another new
nfc mock for the coming nfc_test().This is unnecessary and does not align with the product code logic that
always keeps one NFC Mojo connection alive per page context, unless
something unexpected happens in Device Service.Also, this makes it easier for a nfc_test() to interfere with the next
one, e.g. a nfc_test() ends and closes the NFC Mojo connection, the
disconnection message will arrive at our NFCProxy asynchronously and we
can not have any assumptions on the arrival time, assuming it's still on
the way and the next nfc_test() has already started, at that point our
NFCProxy has no idea that the current Mojo connection was already closed
but continues to talk to it.This CL makes one nfc mock object be reused throughout one test file to
address the above concerns.BUG=1019663
Change-Id: I7e2ae9816936081e1f59688652e34b35a5295af6
Reviewed-on: https://chromium-review.googlesource.com/1913588
WPT-Export-Revision: cc4e17ce4be9eb35ed2d6599d370ed4d28690db7
| Assignee | ||
Comment 1•6 years ago
|
||
| Assignee | ||
Comment 2•6 years ago
|
||
| Assignee | ||
Comment 4•6 years ago
|
||
Comment 5•6 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/089cbd0719a3
https://hg.mozilla.org/mozilla-central/rev/15b3aa3300d2
Description
•