Closed
Bug 935525
Opened 11 years ago
Closed 11 years ago
[NFC] Marionette test cases for NFC
Categories
(Firefox OS Graveyard :: NFC, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
1.4 S1 (14feb)
People
(Reporter: tzimmermann, Assigned: tzimmermann)
References
Details
Attachments
(7 files, 14 obsolete files)
14.68 KB,
text/plain
|
Details | |
57.81 KB,
text/plain
|
Details | |
35.57 KB,
text/plain
|
Details | |
1.67 KB,
text/plain
|
Details | |
2.28 KB,
patch
|
jgriffin
:
review+
|
Details | Diff | Splinter Review |
3.36 KB,
patch
|
vicamo
:
review+
|
Details | Diff | Splinter Review |
2.99 KB,
patch
|
tzimmermann
:
review+
|
Details | Diff | Splinter Review |
This depends on the emulator patches. Some basic tests should be OK for now.
Assignee | ||
Comment 1•11 years ago
|
||
Assignee | ||
Comment 2•11 years ago
|
||
Assignee | ||
Comment 3•11 years ago
|
||
Comment 4•11 years ago
|
||
Failed to build Gecko with the patches.
The error occurred while processing the following file:
/home/vicamo/WorkSpace/mozilla/b2g/qemu/jb/arm/master/2/gecko/dom/nfc/tests/moz.build
The error was triggered on line 7 of this file:
MODULE = 'test_dom_nfc'
Assignee | ||
Comment 5•11 years ago
|
||
Oopsi, bitrotted because of bug 93904. Should work now.
Attachment #831538 -
Attachment is obsolete: true
Assignee | ||
Comment 6•11 years ago
|
||
Comment 7•11 years ago
|
||
Comment on attachment 8341683 [details] [diff] [review]
[01] Bug 935525: Added NFC test infrastructure to build scripts (v2)
Review of attachment 8341683 [details] [diff] [review]:
-----------------------------------------------------------------
have to add to testing/marionette/client/marionette/tests/unit-tests.ini as well
Comment 8•11 years ago
|
||
Comment on attachment 831540 [details] [diff] [review]
[02] Bug 935525: Added marionette test for turning NFC on and off
Review of attachment 831540 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/nfc/tests/marionette/manifest.ini
@@ +2,5 @@
> b2g=true
> browser=false
> qemu=true
> +
> +[test_nfc_enable.js]
test_nfc_enable"d".js
Comment 9•11 years ago
|
||
Comment on attachment 831542 [details] [diff] [review]
[03] Bug 935525: Added Marionette test for nfc-manager-tech-discovered
Review of attachment 831542 [details] [diff] [review]:
-----------------------------------------------------------------
This part crashes emulator. See https://github.com/mozilla-b2g/platform_external_qemu/pull/52#issuecomment-32143430
Assignee | ||
Comment 10•11 years ago
|
||
Attachment #831540 -
Attachment is obsolete: true
Attachment #8362899 -
Flags: review?(allstars.chh)
Assignee | ||
Comment 11•11 years ago
|
||
Attachment #831542 -
Attachment is obsolete: true
Attachment #8362900 -
Flags: review?(allstars.chh)
Assignee | ||
Updated•11 years ago
|
Attachment #8341683 -
Flags: review?(allstars.chh)
I saw Vicamo has already given some comments before, Vicamo, would you like to review this?
(I got some 1.3+ bugs and may not review these soon).
Assignee | ||
Updated•11 years ago
|
Attachment #8341683 -
Flags: review?(allstars.chh) → review?(vyang)
Assignee | ||
Updated•11 years ago
|
Attachment #8362899 -
Flags: review?(allstars.chh) → review?(vyang)
Assignee | ||
Updated•11 years ago
|
Attachment #8362900 -
Flags: review?(allstars.chh) → review?(vyang)
Comment 13•11 years ago
|
||
Comment on attachment 8341683 [details] [diff] [review]
[01] Bug 935525: Added NFC test infrastructure to build scripts (v2)
Review of attachment 8341683 [details] [diff] [review]:
-----------------------------------------------------------------
See comment 7. Or these cases won't be activated by default.
Attachment #8341683 -
Flags: review?(vyang)
Comment 14•11 years ago
|
||
Still get crashed after sending 'nfc ntf rf_intf_activated 0' either by test script or manually.
Comment 15•11 years ago
|
||
I found:
I/USERIAL_LINUX( 47): USERIAL_Open(): enter
I/USERIAL_LINUX( 47): USERIAL_Open() device: /dev/bcm2079x port=5, uart_port=0 WAKE_DELAY(0) WRITE_DELAY(0) POWER_ON_DELAY(300) PRE_POWER_OFF_DELAY(0) POST_POWER_OFF_DELAY(0)
I/USERIAL_LINUX( 47): USERIAL_Open unable to open /dev/bcm2079x
I/USERIAL_LINUX( 47): USERIAL_Open(): exit
Does that matter?
Attachment #8341482 -
Attachment is obsolete: true
Updated•11 years ago
|
Attachment #8364182 -
Attachment description: crash.adb-logcat.txt → crash.marionette.adb-logcat.txt
Updated•11 years ago
|
Attachment #8364181 -
Attachment description: crash.emulator-console.txt → crash.manual.emulator-console.txt
Comment 16•11 years ago
|
||
Comment 17•11 years ago
|
||
Same assertion triggered.
Comment 18•11 years ago
|
||
Comment on attachment 8362899 [details] [diff] [review]
[02] Bug 935525: Added Marionette test for turning NFC on and off (v2)
Review of attachment 8362899 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/nfc/tests/marionette/test_nfc_enabled.js
@@ +3,5 @@
> +
> +MARIONETTE_TIMEOUT = 30000;
> +
> +SpecialPowers.addPermission('nfc', true, document);
> +SpecialPowers.addPermission('settings', true, document);
We'd better not using `{add,remove}Permission` in newly committed code. Please use `pushPermissions` instead.
Attachment #8362899 -
Flags: review?(vyang)
Comment 19•11 years ago
|
||
Comment on attachment 8362900 [details] [diff] [review]
[03] Bug 935525: Added Marionette test for nfc-manager-tech-discovered (v2)
Review of attachment 8362900 [details] [diff] [review]:
-----------------------------------------------------------------
This part still leads to emulator crash but probably should not be the one to blame.
::: dom/nfc/tests/marionette/test_nfc_manager_tech_discovered.js
@@ +3,5 @@
> +
> +MARIONETTE_TIMEOUT = 30000;
> +
> +SpecialPowers.addPermission('nfc-manager', true, document);
> +SpecialPowers.addPermission('settings', true, document);
ditto.
Attachment #8362900 -
Flags: review?(vyang)
Updated•11 years ago
|
Attachment #8362899 -
Flags: feedback+
Comment 20•11 years ago
|
||
Comment on attachment 8362900 [details] [diff] [review]
[03] Bug 935525: Added Marionette test for nfc-manager-tech-discovered (v2)
Review of attachment 8362900 [details] [diff] [review]:
-----------------------------------------------------------------
With fix in bug 916863, these test cases finally turn green!
Attachment #8362900 -
Flags: feedback+
Assignee | ||
Comment 21•11 years ago
|
||
Added fixes from previous review.
Attachment #8341683 -
Attachment is obsolete: true
Attachment #8366537 -
Flags: review?(vyang)
Assignee | ||
Comment 22•11 years ago
|
||
Added fixes from previous review.
Attachment #8362899 -
Attachment is obsolete: true
Attachment #8366541 -
Flags: review?(vyang)
Assignee | ||
Comment 23•11 years ago
|
||
Added fixes from previous review.
Attachment #8362900 -
Attachment is obsolete: true
Attachment #8366542 -
Flags: review?(vyang)
Comment 24•11 years ago
|
||
Comment on attachment 8366537 [details] [diff] [review]
[01] Bug 935525: Added NFC test infrastructure to build scripts (v3)
Review of attachment 8366537 [details] [diff] [review]:
-----------------------------------------------------------------
Ask :jgriffin's review as well.
Attachment #8366537 -
Flags: review?(vyang)
Attachment #8366537 -
Flags: review?(jgriffin)
Attachment #8366537 -
Flags: review+
Comment 25•11 years ago
|
||
Comment on attachment 8366541 [details] [diff] [review]
[02] Bug 935525: Added Marionette test for turning NFC on and off (v3)
Review of attachment 8366541 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/nfc/tests/marionette/test_nfc_enabled.js
@@ +63,5 @@
> + finish();
> +}
> +
> +SpecialPowers.pushPermissions(
> + [{'type':'settings', 'allow':true, 'context':document}], runNextTest());
s/runNextTest()/runNextTest/
Attachment #8366541 -
Flags: review?(vyang) → review-
Comment 26•11 years ago
|
||
Comment on attachment 8366542 [details] [diff] [review]
[03] Bug 935525: Added Marionette test for nfc-manager-tech-discovered (v3)
Review of attachment 8366542 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/nfc/tests/marionette/test_nfc_manager_tech_discovered.js
@@ +73,5 @@
> +}
> +
> +SpecialPowers.pushPermissions(
> + [{'type':'nfc-manager', 'allow':true, context:document},
> + {'type':'settings', 'allow':true, context:document}], runNextTest());
ditto
Attachment #8366542 -
Flags: review?(vyang) → review-
Updated•11 years ago
|
Attachment #8366537 -
Flags: review?(jgriffin) → review+
Assignee | ||
Comment 27•11 years ago
|
||
Attachment #8366541 -
Attachment is obsolete: true
Attachment #8370822 -
Flags: review?(vyang)
Assignee | ||
Comment 28•11 years ago
|
||
Attachment #8366542 -
Attachment is obsolete: true
Attachment #8370823 -
Flags: review?(vyang)
Updated•11 years ago
|
Attachment #8370822 -
Flags: review?(vyang) → review+
Comment 29•11 years ago
|
||
Comment on attachment 8370823 [details] [diff] [review]
[03] Bug 935525: Added Marionette test for nfc-manager-tech-discovered (v4)
Review of attachment 8370823 [details] [diff] [review]:
-----------------------------------------------------------------
All verified with current emulator-jb build. Thank you!
Attachment #8370823 -
Flags: review?(vyang) → review+
Comment 30•11 years ago
|
||
Comment on attachment 8366537 [details] [diff] [review]
[01] Bug 935525: Added NFC test infrastructure to build scripts (v3)
Review of attachment 8366537 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/nfc/tests/marionette/manifest.ini
@@ +1,4 @@
> +[DEFAULT]
> +b2g=true
> +browser=false
> +qemu=true
We can only run these tests on emulator-jb or above, so there are still something to do here. :(
Attachment #8366537 -
Flags: review+
Comment 31•11 years ago
|
||
backedout from inbound on request from tdz in 855c5a0c6828
Comment 32•11 years ago
|
||
(In reply to Carsten Book [:Tomcat] from comment #31)
> backedout from inbound on request from tdz in 855c5a0c6828
Oops, I don't know they're already in inbound :X
Assignee | ||
Comment 33•11 years ago
|
||
Attachment #8370822 -
Attachment is obsolete: true
Attachment #8372285 -
Flags: review?(vyang)
Assignee | ||
Comment 34•11 years ago
|
||
Attachment #8370823 -
Attachment is obsolete: true
Attachment #8372287 -
Flags: review?(vyang)
Assignee | ||
Comment 35•11 years ago
|
||
v5 of the Marionette tests immediately succeed on systems without NFC. This makes them work on both, emulator and emulator-js.
Assignee | ||
Comment 36•11 years ago
|
||
s/emulator-js/emulator-jb
Comment 37•11 years ago
|
||
Comment on attachment 8372285 [details] [diff] [review]
[02] Bug 935525: Added Marionette test for turning NFC on and off (v5)
Review of attachment 8372285 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/nfc/tests/marionette/test_nfc_enabled.js
@@ +64,5 @@
> + if ('mozNfc' in window.navigator) {
> + runNextTest();
> + } else {
> + // succeed immediately on systems without NFC
> + ok(true, 'Failed on system without NFC');
s/Failed/Skipped/. Please also have a |log(...)| line to print on console directly. |ok(...)| is only printed in output of `adb logcat`
Attachment #8372285 -
Flags: review?(vyang) → review+
Comment 38•11 years ago
|
||
Comment on attachment 8372287 [details] [diff] [review]
[03] Bug 935525: Added Marionette test for nfc-manager-tech-discovered (v5)
Review of attachment 8372287 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/nfc/tests/marionette/test_nfc_manager_tech_discovered.js
@@ +73,5 @@
> + if ('mozNfc' in window.navigator) {
> + runNextTest();
> + } else {
> + // succeed immediately on systems without NFC
> + ok(true, 'Failed on system without NFC');
ditto.
Attachment #8372287 -
Flags: review?(vyang) → review+
Assignee | ||
Comment 39•11 years ago
|
||
(In reply to Vicamo Yang [:vicamo][:vyang] from comment #37)
> Comment on attachment 8372285 [details] [diff] [review]
> [02] Bug 935525: Added Marionette test for turning NFC on and off (v5)
>
> Review of attachment 8372285 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: dom/nfc/tests/marionette/test_nfc_enabled.js
> @@ +64,5 @@
> > + if ('mozNfc' in window.navigator) {
> > + runNextTest();
> > + } else {
> > + // succeed immediately on systems without NFC
> > + ok(true, 'Failed on system without NFC');
>
> s/Failed/Skipped/. Please also have a |log(...)| line to print on console
> directly. |ok(...)| is only printed in output of `adb logcat`
Correct me if I'm wrong, but it seems that this 'bogus' test is necessary. When I called finish() directly, Marionette complained that no tests have been executed. So I added the ok(), and 'Failed...' is just the error message.
Comment 40•11 years ago
|
||
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #39)
> (In reply to Vicamo Yang [:vicamo][:vyang] from comment #37)
> > s/Failed/Skipped/. Please also have a |log(...)| line to print on console
> > directly. |ok(...)| is only printed in output of `adb logcat`
>
> Correct me if I'm wrong, but it seems that this 'bogus' test is necessary.
> When I called finish() directly, Marionette complained that no tests have
> been executed. So I added the ok(), and 'Failed...' is just the error
> message.
Yes, that's necessary, and that's why I used "also". :)
Assignee | ||
Comment 41•11 years ago
|
||
OK, next round. I added some logging to the tests. I also moved the generic code into a separate file.
Attachment #8372285 -
Attachment is obsolete: true
Attachment #8373909 -
Flags: review?(vyang)
Assignee | ||
Comment 42•11 years ago
|
||
Attachment #8372287 -
Attachment is obsolete: true
Attachment #8373910 -
Flags: review?(vyang)
Updated•11 years ago
|
Attachment #8373909 -
Flags: review?(vyang) → review+
Comment 43•11 years ago
|
||
Comment on attachment 8373910 [details] [diff] [review]
[03] Bug 935525: Added Marionette test for nfc-manager-tech-discovered (v6)
Review of attachment 8373910 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/nfc/tests/marionette/test_nfc_manager_tech_discovered.js
@@ +13,5 @@
> +
> +function activateRE0() {
> + var cmd = 'nfc ntf rf_intf_activated 0';
> + log('Executing \'' + cmd + '\'');
> + runEmulatorCmd(cmd, function(result) {
Should have noticed. Whenever we're calling built-in `runEmulatorCmd()`, we have to manually keep track of its execution count and make sure all of the calls are already finished before calling `finish()` at the end of the test script. Please see https://mxr.mozilla.org/mozilla-central/source/dom/mobilemessage/tests/marionette/head.js#270 for example.
Attachment #8373910 -
Flags: review?(vyang) → review+
Assignee | ||
Comment 44•11 years ago
|
||
Ok, great. I'll update and land the patches then. Thanks a lot!
Assignee | ||
Comment 45•11 years ago
|
||
Attachment #8373910 -
Attachment is obsolete: true
Attachment #8374756 -
Flags: review+
Assignee | ||
Comment 46•11 years ago
|
||
Comment 47•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/6e1e721b044a
https://hg.mozilla.org/mozilla-central/rev/43b33c890e57
https://hg.mozilla.org/mozilla-central/rev/5dc42ca15601
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → 1.4 S1 (14feb)
You need to log in
before you can comment on or make changes to this bug.
Description
•