mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-10 02:08:38 +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,58 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
Test that when we remove one of a process's frames from the DOM, the process's
|
||||
priority is recomputed.
|
||||
-->
|
||||
<head>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="../browserElementTestHelpers.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script type="application/javascript;version=1.7">
|
||||
"use strict";
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
browserElementTestHelpers.setEnabledPref(true);
|
||||
browserElementTestHelpers.enableProcessPriorityManager();
|
||||
|
||||
function runTest() {
|
||||
var iframe = document.createElement('iframe');
|
||||
iframe.setAttribute('mozbrowser', true);
|
||||
iframe.src = 'file_MultipleFrames.html';
|
||||
|
||||
var childID = null;
|
||||
var iframe2;
|
||||
Promise.all([
|
||||
expectProcessCreated('FOREGROUND').then(function(chid) {
|
||||
childID = chid;
|
||||
}),
|
||||
new Promise(function(resolve, reject) {
|
||||
iframe.addEventListener('mozbrowseropenwindow', function(e) {
|
||||
iframe2 = e.detail.frameElement;
|
||||
var p = expectMozbrowserEvent(iframe2, 'loadend');
|
||||
document.body.appendChild(iframe2);
|
||||
resolve(p);
|
||||
});
|
||||
})
|
||||
]).then(function() {
|
||||
// At this point, the child process has been set to FOREGROUND, and the popup
|
||||
// opened by file_MultipleFrames has finished loading.
|
||||
//
|
||||
// Now setVisible(false) the popup frame and remove the popup frame from the
|
||||
// DOM. This should cause the process to take on BACKGROUND priority.
|
||||
var p = expectPriorityChange(childID, 'BACKGROUND');
|
||||
iframe.setVisible(false);
|
||||
document.body.removeChild(iframe2);
|
||||
return p;
|
||||
}).then(SimpleTest.finish);
|
||||
|
||||
document.body.appendChild(iframe);
|
||||
}
|
||||
|
||||
addEventListener('testready', runTest);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue