mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 834699 - Fix tests that munge dom.xbl_scopes. r=bz
This commit is contained in:
parent
4d84f3f37c
commit
f8786d3cd8
@ -32,9 +32,7 @@ var url = 'data:text/html;charset=utf-8,' +
|
||||
encodeURIComponent('<div id=t style="-moz-binding:url(' + location + '#xbl)"></div>');
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(function() {
|
||||
SpecialPowers.pushPrefEnv({set: [['dom.xbl_scopes', true]]}, test1);
|
||||
});
|
||||
addLoadEvent(test1);
|
||||
|
||||
function test1() {
|
||||
var iframe = document.createElement('iframe');
|
||||
@ -46,21 +44,6 @@ function test1() {
|
||||
is(t.textContent, "true",
|
||||
"getUserData and setUserData should be visible from XBL");
|
||||
document.body.removeChild(iframe);
|
||||
SpecialPowers.pushPrefEnv({set: [['dom.xbl_scopes', false]]}, test2);
|
||||
};
|
||||
document.body.appendChild(iframe);
|
||||
}
|
||||
|
||||
function test2() {
|
||||
var iframe = document.createElement('iframe');
|
||||
iframe.src = url;
|
||||
iframe.onload = function() {
|
||||
var t = iframe.contentWindow.t;
|
||||
is(!!(t.getUserData && t.setUserData), true,
|
||||
"getUserData and setUserData is visible if XBL scopes are disabled");
|
||||
is(t.textContent, "true",
|
||||
"getUserData and setUserData should be visible from XBL");
|
||||
document.body.removeChild(iframe);
|
||||
SimpleTest.finish();
|
||||
};
|
||||
document.body.appendChild(iframe);
|
||||
|
@ -13,14 +13,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=821850
|
||||
/** Test for XBL scope behavior. **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
// The XBL scope pref is read when a global is constructed, so we need to set
|
||||
// it before loading the test.
|
||||
function setup() {
|
||||
SpecialPowers.pushPrefEnv({set: [['dom.xbl_scopes', true]] }, continueSetup);
|
||||
}
|
||||
|
||||
// Embed the real test. It will take care of everything else.
|
||||
function continueSetup() {
|
||||
//
|
||||
// NB: This two-layer setup used to exist because XBL scopes were behind a
|
||||
// pref, and we wanted to make sure that we properly set the pref before
|
||||
// loading the real test. This stuff is no longer behind a pref, but we just
|
||||
// leave the structure as-is for expediency.
|
||||
function setup() {
|
||||
$('ifr').setAttribute('src', 'file_bug821850.xhtml');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user