Closed
Bug 947010
Opened 11 years ago
Closed 11 years ago
Create automation test for recording status
Categories
(Firefox OS Graveyard :: General, defect)
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)
22.43 KB,
patch
|
schien
:
review+
|
Details | Diff | Splinter Review |
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.
Updated•11 years ago
|
Blocks: b2g-getusermedia
Assignee | ||
Comment 1•11 years ago
|
||
@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)
Comment 2•11 years ago
|
||
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)
Assignee | ||
Comment 3•11 years ago
|
||
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.
Assignee | ||
Comment 4•11 years ago
|
||
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
Assignee | ||
Comment 5•11 years ago
|
||
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 6•11 years ago
|
||
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)
Comment 7•11 years ago
|
||
You probably also should consider kicking off a try run with these mochitests btw.
Comment 8•11 years ago
|
||
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+
Assignee | ||
Comment 9•11 years ago
|
||
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.
Comment 10•11 years ago
|
||
(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.
Assignee | ||
Comment 11•11 years ago
|
||
I've filed Bug 957554 for investigating the mozbrowserloadstart issue.
Assignee | ||
Comment 12•11 years ago
|
||
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+
Assignee | ||
Comment 13•11 years ago
|
||
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)
Assignee | ||
Comment 14•11 years ago
|
||
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.
Assignee | ||
Comment 15•11 years ago
|
||
Comment 16•11 years ago
|
||
(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.
Assignee | ||
Comment 17•11 years ago
|
||
(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.
Updated•11 years ago
|
Attachment #8357093 -
Flags: feedback?(fabrice) → feedback+
Assignee | ||
Comment 18•11 years ago
|
||
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+
Assignee | ||
Updated•11 years ago
|
Attachment #8357093 -
Attachment is obsolete: true
Assignee | ||
Comment 19•11 years ago
|
||
Bug 957554 is now a follow-up bug so remove it from dependent bug list.
No longer depends on: 957554
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 20•11 years ago
|
||
b2g/test/mochitest seems like kind of an odd place for these tests?
Keywords: checkin-needed
Assignee | ||
Comment 21•11 years ago
|
||
(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)
Comment 23•11 years ago
|
||
I am.
Assignee | ||
Comment 24•11 years ago
|
||
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+
Assignee | ||
Comment 25•11 years ago
|
||
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
Comment 26•11 years ago
|
||
Flags: in-testsuite+
Keywords: checkin-needed
Comment 27•11 years ago
|
||
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.
Description
•