Closed Bug 1026785 Opened 10 years ago Closed 10 years ago

Change gen_template.pl -type chrome to use .html files

Categories

(Testing :: Mochitest, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla34

People

(Reporter: jgriffin, Assigned: ahal)

Details

Attachments

(1 file)

gen_template.pl -type chrome currently generates XUL files, but those can't be used in B2G, even after we adapt the mochitest-chrome harness to run there.  We should be defaulting to the use of HTML files for chrome tests.

See https://bugzilla.mozilla.org/show_bug.cgi?id=797164#c23 and later.
I actually advocated killing the gen_template scripts in favor of just having sample tests in the tree that one could copy and paste.
(In reply to Ted Mielczarek [:ted.mielczarek] from comment #1)
> I actually advocated killing the gen_template scripts in favor of just
> having sample tests in the tree that one could copy and paste.

+1.  I'm not sure the gen_template.pl script actually buys us much.
Ted, is this something that you (or someone) could fix on the sooner side? It's probably low effort, and doing it sooner means that everyone (including myself) stops creating more .xul tests.
Flags: needinfo?(ted)
I'm not likely to do this, sorry.
Flags: needinfo?(ted)
jgriffin, can you find an owner? A stitch in time definitely saves nine here.
Flags: needinfo?(jgriffin)
Ahal, can you take a crack at this?
Flags: needinfo?(jgriffin) → needinfo?(ahalberstadt)
Sure, all this script does is print the contents of the relevant file here:
http://mxr.mozilla.org/mozilla-central/find?string=testing%2Fmochitest%2Fstatic&tree=mozilla-central&hint=

So it's just a matter of editing 'chrome.template.txt' to taste. Is the intent here to just replace the contents of 'chrome.template.txt' with the contents of 'test.template.txt'? Are there any changes you'd want made on top of 'test.template.txt'?
Assignee: nobody → ahalberstadt
Flags: needinfo?(ahalberstadt) → needinfo?(bobbyholley)
I'm no expert at writing mochitests, so I'm not a good judge of what should be in the template. Ideally I'd like someone who writes lots of chrome mochitests to paste exactly what they want in the template.
We basically want chrome.template.txt to look as much like the test.template.txt as possible, except the URIs need to be set up so that they work with the test harness. We should keep the xul version around it, but rename it to xul.template.txt.
Flags: needinfo?(bobbyholley)
I think this is what you want. This adds a new "chromexul" type which prints the old template ("xul" was already taken for mochitest-plain).

Doing "--type chrome" now prints the same thing as test.template.txt except with the urls modified and the 'chrome://global/skin' stylesheet added.
Attachment #8467868 - Flags: review?(bobbyholley)
Comment on attachment 8467868 [details] [diff] [review]
gen_template_html

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

This looks great, thank you! r=bholley assuming you tested it.
Attachment #8467868 - Flags: review?(bobbyholley) → review+
https://hg.mozilla.org/mozilla-central/rev/3d6182f6edfb
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Component: Mochitest Chrome → Mochitest
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: