Closed Bug 947010 Opened 11 years ago Closed 11 years ago

Create automation test for recording status

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
1.3 C3/1.4 S3(31jan)

People

(Reporter: schien, Assigned: schien)

References

Details

Attachments

(1 file, 4 obsolete files)

Need some test case for testing mozChromeEvent change for recording status, especially for any change made in shell.js. We might need to redirect mozChromeEvent event from b2g process to content process via specialpower API so that we verify if mozChromeEvent is generated as expected.
@ahal, I'm looking for a test framework that can execute test case in content process and verify the generated CustomEvent, i.e. mozChromeEvent in chrome process. Some one point me to use the SpecialPowers.loadChromeScript(), however, the chrome script is executed in a sandbox that cannot capture the CustomEvent. Can you give me some suggestion on which test framework I should use, or the way I can extend SpecialPower for this kind of test requirement?
Flags: needinfo?(ahalberstadt)
I'm not super familiar with specialpowers, but could you use SpecialPowers.addChromeEventListener()? https://developer.mozilla.org/en-US/docs/SpecialPowers#Event_Listener_APIs
Flags: needinfo?(ahalberstadt)
Thanks @ahal, looks like SpecialPowers.addChromeEventListener() can only capture the event that generated in content process because the event listener is attached to TabChild. However I do find out marionette test API have addChromeEventListener/sendContentEvent that exactly matched with our requirement. I'll use js marionette to write the test case.
Just put a reference to existing marionette API. It's only used in updater testcase right now. http://dxr.mozilla.org/mozilla-central/source/testing/marionette/client/marionette/atoms/b2g_update_test.js#60
Attached patch testcase.patch (obsolete) — Splinter Review
cover following 4 scenarios: 1. create single media stream 2. create multiple media stream at the same time 3. create media stream in iframe (the same origin) 4. kill content process while recording active (simulate receiving ipc:content-shutdown)
Attachment #8355158 - Flags: review?(jsmith)
Comment on attachment 8355158 [details] [diff] [review] testcase.patch I'm not the best person to review a chrome-driven mochitest, so I'm going to redirect this. Fabrice probably could help review this though.
Attachment #8355158 - Flags: review?(jsmith) → review?(fabrice)
You probably also should consider kicking off a try run with these mochitests btw.
Comment on attachment 8355158 [details] [diff] [review] testcase.patch Review of attachment 8355158 [details] [diff] [review]: ----------------------------------------------------------------- That looks good to me, thanks for working on that! As Jason said, please push to try first (let me know if you can't). ::: b2g/chrome/content/shell.js @@ +1276,5 @@ > // videoCount: <N>}} > let gRecordingActiveProcesses = {}; > > let recordingHandler = function(aSubject, aTopic, aData) { > + dump('recording status: ' + aData); nit: remove before landing. ::: b2g/test/mochitest/file_getusermedia_iframe.html @@ +26,5 @@ > + case 'stop': > + localStream.stop(); > + localStream = null; > + break; > + } nit: trailing whitespace.
Attachment #8355158 - Flags: review?(fabrice) → review+
These testcase cannot run on b2g-desktop right now because b2g-desktop doesn't support OOP mochitest. All the mozChromeEvent will be pending because no mozbrowserloadstart event is triggered. I'll exclude these testcases from b2g-desktop.json for now.
(In reply to Shih-Chiang Chien [:schien] from comment #9) > These testcase cannot run on b2g-desktop right now because b2g-desktop > doesn't support OOP mochitest. All the mozChromeEvent will be pending > because no mozbrowserloadstart event is triggered. I'll exclude these > testcases from b2g-desktop.json for now. Even without running OOP we should have mozbrowserloadstart triggered. Let's investigate that first.
I've filed Bug 957554 for investigating the mozbrowserloadstart issue.
Attached patch testcase.patch, v2 (obsolete) — Splinter Review
Update according to comment #8 and comment #9. Here is the try result for emulator mochitest: https://tbpl.mozilla.org/?tree=Try&rev=e2cb17272c1d.
Attachment #8355158 - Attachment is obsolete: true
Attachment #8357086 - Flags: review+
mochitest-b2g-desktop will success after applying this workaround. Here is the try result: https://tbpl.mozilla.org/?tree=Try&rev=c71df4fc7d08. We may land testcase.patch first, then re-enable these testcases in bug 957554.
Attachment #8357093 - Flags: feedback?(fabrice)
Based on my investigation in bug 957554 comment #2, I'm quite confident to say that we should re-enable these testcases on b2g-desktop after OOP is enabled on it.
(In reply to Shih-Chiang Chien [:schien] from comment #15) > Full try in https://tbpl.mozilla.org/?tree=Try&rev=a1d66b080172 Looks like you forgot to push your changes in that last try run.
(In reply to Andrew Halberstadt [:ahal] from comment #16) > (In reply to Shih-Chiang Chien [:schien] from comment #15) > > Full try in https://tbpl.mozilla.org/?tree=Try&rev=a1d66b080172 > > Looks like you forgot to push your changes in that last try run. No, I don't. My changeset was pushed to TBPL in another try run in comment #12 and doesn't got changed since than. So, the TBPL only displayed the changeset I made on top of it, which is the try command. I've confirmed that my change is included in this try run from the revision log https://hg.mozilla.org/try/rev/a1d66b080172. The parent node is pointed to 91f38ef4e8fa, which is the testcase.patch.
Attachment #8357093 - Flags: feedback?(fabrice) → feedback+
Attached patch testcases.patch v2.1 (obsolete) — Splinter Review
Rebase to latest m-c and add the follow-up bug id in b2g-desktop.json. Per discussion with @fabrice today, we'll enable the test case on emulator first and enable it on b2g-desktop after bug 957554 is fixed. try result: https://tbpl.mozilla.org/?tree=Try&rev=6fa9da1d004a
Attachment #8357086 - Attachment is obsolete: true
Attachment #8363413 - Flags: review+
Attachment #8357093 - Attachment is obsolete: true
Bug 957554 is now a follow-up bug so remove it from dependent bug list.
No longer depends on: 957554
b2g/test/mochitest seems like kind of an odd place for these tests?
Keywords: checkin-needed
(In reply to Ryan VanderMeulen [:RyanVM UTC-5] from comment #20) > b2g/test/mochitest seems like kind of an odd place for these tests? These test cases are for b2g/chrome/content/shell.js. How about moving these to b2g/chrome/content/test/mochitest? Do you think it is a suitable place for these tests?
Flags: needinfo?(ryanvm)
SGTM if Fabrice is OK with it.
Flags: needinfo?(ryanvm)
I am.
Move all the test cases to b2g/chrome/content/test/mochitest, carry r+. Will mark checkin-needed after try shows green. try: https://tbpl.mozilla.org/?tree=Try&rev=091eb0a77157
Attachment #8363413 - Attachment is obsolete: true
Attachment #8364209 - Flags: review+
Mark "checkin-needed" because this patch works well on my local environment and try is busted for all B2G Emulator builds currently (bug 963148)
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.3 C3/1.4 S3(31jan)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: