Closed Bug 1162836 Opened 7 years ago Closed 7 years ago

Fix NFC marionette testcase fail

Categories

(Firefox OS Graveyard :: NFC, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(firefox41 fixed)

RESOLVED FIXED
2.2 S13 (29may)
Tracking Status
firefox41 --- fixed

People

(Reporter: dimi, Assigned: dimi)

References

Details

Attachments

(1 file, 3 obsolete files)

We have done a lots of refactoring on NFC but we didn't update testcase accordingly.
This bug is used to fix those testcases fail.
Depends on: 1163952
Attached patch Patch v1 (obsolete) — Splinter Review
Attachment #8605699 - Flags: review?(allstars.chh)
Comment on attachment 8605699 [details] [diff] [review]
Patch v1

Review of attachment 8605699 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/nfc/tests/marionette/head.js
@@ +200,5 @@
>  
> +  // In bug 1109592, nfcd will only run when nfc is enabled
> +  // The way we activate/deactivate nfcd is by using set property "ctl.start" & "ctl.stop"
> +  // In emulator it seems sometimes enable/disable NFC too quick will cause nfcd won't start
> +  // So here is just a simple workaround too delay enable or disable

file a bug

::: dom/nfc/tests/marionette/test_nfc_checkP2PRegistration.js
@@ +50,5 @@
>  function testWithSessionTokenWithTarget() {
>    log('testWithSessionTokenWithTarget');
>    toggleNFC(true)
> +  .then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0, false))
> +  .then(waitTechDiscovered)

waitForTechDiscovered

@@ +71,5 @@
>    log('testWithSessionTokenNoTarget');
>    toggleNFC(true)
> +  .then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0, false))
> +  .then(waitTechDiscovered)
> +  .then(() => nfc.checkP2PRegistration(FAKE_MANIFEST_URL))

should use MANIFEST_URL, as the original code does

::: dom/nfc/tests/marionette/test_nfc_error_messages.js
@@ +138,5 @@
>    NCI.deactivate();
>    return deferred.promise;
>  }
>  
> +function waitTechDiscovered() {

move this to head.js ?
Attachment #8605699 - Flags: review?(allstars.chh) → review+
Blocks: 1164786
Attached patch Patch v2 (obsolete) — Splinter Review
Address yoshi's comment
Attachment #8605699 - Attachment is obsolete: true
Attachment #8605736 - Flags: review+
Attached patch Patch v3 (obsolete) — Splinter Review
I have update testcases as discussed that tech lost will be triggered by testcase itself
Attachment #8605736 - Attachment is obsolete: true
Attachment #8607428 - Flags: review?(allstars.chh)
Comment on attachment 8607428 [details] [diff] [review]
Patch v3

Review of attachment 8607428 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/nfc/tests/marionette/test_nfc_read_tag.js
@@ +15,5 @@
>    let payload = url;
>  
>    sysMsgHelper.waitForTechDiscovered(function(msg) {
>      log("Received \'nfc-manager-tech-ndiscovered\'");
> +    ok(msg.peer === undefined, "check for correct message type");

the message needs to be updated
Attachment #8607428 - Flags: review?(allstars.chh) → review+
Attached patch Patch v4Splinter Review
Address yoshi's comment
Attachment #8607428 - Attachment is obsolete: true
Attachment #8607501 - Flags: review+
This patch only update marionette-webapi test,
try result:
https://treeherder.allizom.org/#/jobs?repo=try&revision=b00b4fb24cab
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/1f529b19f295
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.2 S13 (29may)
Blocks: emulator-kk
You need to log in before you can comment on or make changes to this bug.