Closed
Bug 805838
Opened 12 years ago
Closed 11 years ago
Allow JavaScript Marionette tests to import a script for common code
Categories
(Remote Protocol :: Marionette, defect)
Remote Protocol
Marionette
Tracking
(firefox27 fixed, b2g-v1.2 fixed)
RESOLVED
FIXED
mozilla27
People
(Reporter: davehunt, Assigned: aknow)
References
Details
Attachments
(2 files, 1 obsolete file)
4.36 KB,
patch
|
Details | Diff | Splinter Review | |
2.10 KB,
patch
|
Details | Diff | Splinter Review |
In order to reduce duplication across WebAPI tests, it would be beneficial to allow importing of JavaScript files containing common functions.
Comment 1•12 years ago
|
||
We'll have a way to import scripts as soon as we land the change in this bug.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
Comment 2•12 years ago
|
||
I believe it will be good to keep this bug open regarding any dependency we have here to create Marionette tests. Bug 797912 is too general to understand why we depend on it. Usually we add a dependency in such a case.
Status: RESOLVED → REOPENED
Depends on: 797912
Resolution: DUPLICATE → ---
Whiteboard: [needs bug 797912]
Comment 3•12 years ago
|
||
Yes, this won't be helped by bug 797912, because this will need to call back into the client to fetch the script to load.
Comment 4•12 years ago
|
||
This will require a completely separate implementation from bug 797912, so am removing that as a dependency.
No longer depends on: 797912
Whiteboard: [needs bug 797912]
Blocks: 797296
Blocks: 843455
No longer blocks: 797296
Assignee | ||
Comment 7•11 years ago
|
||
What's the current status of this one? I've raise a duplicate bug 917223 and come here from that bug.
Another duplicate Bug 734189 suggest a node.js-style 'require' statement. For that solution, We might need to handle the scope issue and manipulate the js script.
In bug 917223, my initial idea is to introduce a tag in the test script
MARIONETTE_JS_HEADER = 'head.js';
We could just simply prepend the head.js and the run the script. It could be implement in marionette client.
Comment 8•11 years ago
|
||
I like the head.js approach, as it's considerably simpler than a 'require' implementation.
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → szchen
Assignee | ||
Comment 9•11 years ago
|
||
Attachment #806416 -
Flags: review?(jgriffin)
Assignee | ||
Comment 10•11 years ago
|
||
Example test case that use head.js to do some common setup and teardown works.
Assignee | ||
Updated•11 years ago
|
Attachment #806417 -
Attachment description: 0001-Example-test-with-head.js.patch → Example test with head.js
Assignee | ||
Comment 11•11 years ago
|
||
(In reply to Szu-Yu Chen [:aknow] from comment #9)
> Created attachment 806416 [details] [diff] [review]
> Add MARIONETTE_HEAD_JS support
Some limitation now.
1. Only allow to prepend 1 head.js.
2. Not allow nested HEAD. We should not put the line of MARIONETTE_HEAD_JS = xxx in some head.js
It's not hard to break the above limitations. However, I would like to keep them as the restrictions and make everything simple.
Comment 12•11 years ago
|
||
Comment on attachment 806416 [details] [diff] [review]
Add MARIONETTE_HEAD_JS support
Review of attachment 806416 [details] [diff] [review]:
-----------------------------------------------------------------
Looks great, thanks for the patch!
Attachment #806416 -
Flags: review?(jgriffin) → review+
Assignee | ||
Comment 13•11 years ago
|
||
Attachment #806416 -
Attachment is obsolete: true
Assignee | ||
Comment 14•11 years ago
|
||
Keywords: checkin-needed
Assignee | ||
Comment 15•11 years ago
|
||
We should also update the mdn for the new test flag (MARIONETTE_HEAD_JS).
https://developer.mozilla.org/en-US/docs/Marionette/Marionette_JavaScript_Tests
Comment 16•11 years ago
|
||
Keywords: checkin-needed
Comment 17•11 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 12 years ago → 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
Comment 18•11 years ago
|
||
status-b2g-v1.2:
--- → fixed
status-firefox27:
--- → fixed
Updated•2 years ago
|
Product: Testing → Remote Protocol
You need to log in
before you can comment on or make changes to this bug.
Description
•