Closed
Bug 987596
Opened 11 years ago
Closed 11 years ago
B2G NFC: Marionette tests for onpeerready
Categories
(Firefox OS Graveyard :: NFC, defect)
Tracking
(tracking-b2g:backlog)
People
(Reporter: allstars.chh, Assigned: allstars.chh)
References
Details
(Whiteboard: [p=2])
Attachments
(1 file, 2 obsolete files)
5.96 KB,
patch
|
dimi
:
review+
|
Details | Diff | Splinter Review |
We need a marionette test case for testing onpeerready.
Updated•11 years ago
|
blocking-b2g: --- → backlog
Assignee | ||
Comment 1•11 years ago
|
||
Attachment #8412527 -
Flags: review?(dlee)
Comment 2•11 years ago
|
||
Comment on attachment 8412527 [details] [diff] [review]
Patch
Review of attachment 8412527 [details] [diff] [review]:
-----------------------------------------------------------------
Pass local marionette test case.
::: dom/nfc/tests/marionette/test_nfc_peer.js
@@ +5,5 @@
> +MARIONETTE_HEAD_JS = 'head.js';
> +
> +let MANIFEST_URL = "app://system.gaiamobile.org/manifest.webapp";
> +let Promise =
> + SpecialPowers.Cu.import("resource://gre/modules/Promise.jsm").Promise;
I think we could move Promise to head.js because more and more testcases will use it in the future.
@@ +12,5 @@
> +function testPeerReady(evt) {
> + log("testPeerReady called");
> + let peer = nfc.getNFCPeer(evt.detail);
> + ok(peer instanceof MozNFCPeer, "Should get a NFCPeer object.");
> + runNextTest();
Should we call toggleNFC(false, runNextTest); ?
@@ +29,5 @@
> + }
> +
> + request.onerror = function () {
> + ok(false, "checkP2PRegistration failed.");
> + runNextTest();
ditto.
@@ +38,5 @@
> + let deferred = Promise.defer();
> + let cmd = "nfc ntf rf_intf_activated " + re;
> +
> + emulator.run(cmd, function(result) {
> + is(result.pop(), "OK", "check activation of RE0");
We should use is(result.pop(), "OK", "check activation of RE" + re);
Please also help modify test_nfc_manager_tech_discovered.js, thanks
@@ +56,5 @@
> + });
> +}
> +
> +let tests = [
> + testActivateRE0
Naming of this testcase seems not match what we are going to test ?
Attachment #8412527 -
Flags: review?(dlee)
Assignee | ||
Comment 3•11 years ago
|
||
addressed Dimi's comments.
Attachment #8412527 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Attachment #8413622 -
Flags: review?(dlee)
Assignee | ||
Updated•11 years ago
|
Attachment #8413622 -
Flags: review?(dlee)
Comment 4•11 years ago
|
||
Comment on attachment 8413622 [details] [diff] [review]
Patch v2.
Review of attachment 8413622 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks for code refine, could you also help remove import Promise in test_nfc_manager_tech_discovered.js.
r+ with nits fixed
::: dom/nfc/tests/marionette/test_nfc_manager_tech_discovered.js
@@ +23,5 @@
> let deferred = Promise.defer();
> let cmd = 'nfc ntf rf_intf_activated ' + re;
>
> emulator.run(cmd, function(result) {
> + is(result.pop(), 'OK', 'check activation of RE0' + re);
Nits, Remove 0 from RE0
::: dom/nfc/tests/marionette/test_nfc_peer.js
@@ +39,5 @@
> + let deferred = Promise.defer();
> + let cmd = "nfc ntf rf_intf_activated " + re;
> +
> + emulator.run(cmd, function(result) {
> + is(result.pop(), "OK", "check activation of RE0" + re);
Nits. Remove 0 from RE0
Attachment #8413622 -
Flags: review+
Assignee | ||
Comment 5•11 years ago
|
||
Attachment #8413622 -
Attachment is obsolete: true
Assignee | ||
Comment 6•11 years ago
|
||
Comment on attachment 8413635 [details] [diff] [review]
Patch v3.
Review of attachment 8413635 [details] [diff] [review]:
-----------------------------------------------------------------
Addressed Comment 4.
Also move declaration of nfc into head.js. r? for this change.
Attachment #8413635 -
Flags: review?(dlee)
Updated•11 years ago
|
Attachment #8413635 -
Flags: review?(dlee) → review+
Assignee | ||
Comment 7•11 years ago
|
||
Whiteboard: [p=2]
Target Milestone: --- → 2.0 S1 (9may)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•10 years ago
|
blocking-b2g: backlog → ---
tracking-b2g:
--- → backlog
You need to log in
before you can comment on or make changes to this bug.
Description
•