mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-12 10:17:31 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
|
|
@ -0,0 +1,69 @@
|
|||
/* Any copyright is dedicated to the public domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Bug 829486 - Add mozdocumentbrowserfirstpaint event.
|
||||
"use strict";
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
browserElementTestHelpers.setEnabledPref(true);
|
||||
|
||||
var iframe;
|
||||
|
||||
function runTestQueue(queue) {
|
||||
if (queue.length == 0) {
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
}
|
||||
|
||||
var gotFirstPaint = false;
|
||||
var gotFirstLocationChange = false;
|
||||
var test = queue.shift();
|
||||
|
||||
function runNext() {
|
||||
iframe.removeEventListener('mozbrowserdocumentfirstpaint', documentfirstpainthandler);
|
||||
iframe.removeEventListener('mozbrowserloadend', loadendhandler);
|
||||
runTestQueue(queue);
|
||||
}
|
||||
|
||||
function documentfirstpainthandler(e) {
|
||||
ok(!gotFirstPaint, "Got firstpaint only once");
|
||||
gotFirstPaint = true;
|
||||
if (gotFirstLocationChange) {
|
||||
runNext();
|
||||
}
|
||||
}
|
||||
|
||||
function loadendhandler(e) {
|
||||
gotFirstLocationChange = true;
|
||||
if (gotFirstPaint) {
|
||||
runNext();
|
||||
}
|
||||
}
|
||||
|
||||
iframe.addEventListener('mozbrowserdocumentfirstpaint', documentfirstpainthandler);
|
||||
iframe.addEventListener('mozbrowserloadend', loadendhandler);
|
||||
|
||||
test();
|
||||
}
|
||||
|
||||
function testChangeLocation() {
|
||||
iframe.src = browserElementTestHelpers.emptyPage1 + "?2";
|
||||
}
|
||||
|
||||
function testReload() {
|
||||
iframe.reload();
|
||||
}
|
||||
|
||||
function testFirstLoad() {
|
||||
document.body.appendChild(iframe);
|
||||
iframe.src = browserElementTestHelpers.emptyPage1;
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
iframe = document.createElement('iframe');
|
||||
iframe.setAttribute('mozbrowser', 'true');
|
||||
|
||||
runTestQueue([testFirstLoad, testReload, testChangeLocation]);
|
||||
}
|
||||
|
||||
addEventListener('testready', runTest);
|
||||
Loading…
Add table
Add a link
Reference in a new issue