Closed Bug 501100 Opened 16 years ago Closed 16 years ago

Print preview mochitests should be chrome tests

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: roc, Assigned: roc)

References

Details

Attachments

(1 file)

Attached patch fixSplinter Review
In layout/base/tests we have a few tests that use chrome privileges to put a content IFRAME of a content document into print preview mode. My work in bug 352093 breaks these tests because the print engine doesn't know how to print a document that has no widget. Hacking the print engine to handle that is quite difficult, and pointless since there is no legitimate use for putting an IFRAME of a content document into print preview mode. So we should convert these tests to chrome tests and run them in a chrome window so that the IFRAME to be printed is a child of chrome, like the browser's print preview. This means we don't need enablePrivilege, which is also nice. It means onload on the iframe doesn't fire, so instead I have the iframe call a function in its parent document.
Attachment #385718 - Flags: review?(martijn.martijn)
(In reply to comment #0) > ... and pointless since there is no legitimate use for putting an IFRAME > of a content document into print preview mode. Huh? I'm using that a lot in my testing, actually. Why is there no legitimate use for it? Or do you mean there is currently no legitimate use for it?
I mean there is no real use for it for actual users of the browser (Web developers and chrome/extension developers). I know you do a lot of good testing with it, but you can do that testing using chrome tests (I hope) like the tests I've converted here.
Comment on attachment 385718 [details] [diff] [review] fix Sorry for the delay, I had horrible problems with Mercurial. In bug482976_helper.xul, you add: +<iframe src="data:text/html;charset=utf-8,&lt;body onload='window.parent.loadedChild()'&gt;"></iframe> , but the original file, test_bug482976.html, had: -<iframe onload="SimpleTest.waitForExplicitFinish(); setTimeout(run1, 0); this.removeAttribute('onload')" - src="data:text/html,<q>"></iframe> This is what bug 482976 was about, the fact that <q> tags caused crashes on print preview. So please add that back in your patch. The tests seem to run fine on my machine, btw. I'm still looking at the rest.
Comment on attachment 385718 [details] [diff] [review] fix The rest looks ok to me.
Attachment #385718 - Flags: review?(martijn.martijn) → review+
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Did you change what I said in comment 3? It seems like you didn't.
I did: +<iframe src="data:text/html;charset=utf-8,&lt;body onload='window.parent.loadedChild()'&gt;&lt;q&gt;"></iframe>
Sorry, I misread the patch.
A just landed checkin referenced this bug as "followup to Bug 501100" but since the followup was never mentioned here, I'm doing so now: Bug 556686
Blocks: 556686
Flags: in-testsuite+
Target Milestone: --- → mozilla1.9.2a1
Blocks: 671976
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: