Bug 857356 - Convert field-y XBL tests to run with dom.use_xbl_scopes_for_remote_xul=false. r=bz

There are a couple of tests here that do funny things with fields. Our basic
position here is that fields have no place for in-content XBL bindings, but
there's still value in testing this stuff given our heavy usage of XBL in
chrome code. They really should be converted to chrome tests, but I was having
trouble doing that, so I decided to convert them to run without XBL scopes, like
we do for remote XUL.

As a nice side effect, this gives us a tiny bit more test coverage for the
remote XUL configuration.

--HG--
rename : content/xbl/test/test_bug372769.xhtml => content/xbl/test/file_bug372769.xhtml
rename : content/xbl/test/test_bug397934.xhtml => content/xbl/test/file_bug397934.xhtml
This commit is contained in:
Bobby Holley 2013-05-09 09:16:02 -07:00
parent 23a6a80c76
commit 76d7cbe7e6
5 changed files with 88 additions and 15 deletions

View File

@ -16,9 +16,11 @@ MOCHITEST_FILES = \
bug310107-resource.xhtml \
test_bug366770.html \
test_bug371724.xhtml \
test_bug372769.xhtml \
test_bug372769.html \
file_bug372769.xhtml \
test_bug378866.xhtml \
test_bug397934.xhtml \
test_bug397934.html \
file_bug397934.xhtml \
test_bug389322.xhtml \
test_bug400705.xhtml \
test_bug401907.xhtml \

View File

@ -4,8 +4,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=372769
-->
<head>
<title>Test for Bug 372769</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<bindings xmlns="http://www.mozilla.org/xbl">
<binding id="test1">
<implementation>
@ -84,8 +82,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=372769
<![CDATA[
/** Test for Bug 372769 **/
SimpleTest.waitForExplicitFinish();
addLoadEvent(function() {
SimpleTest = parent.SimpleTest;
ok = parent.ok;
is = parent.is;
$ = function(x) { return document.getElementById(x); }
window.onload = function() {
var d = $("display1");
is(d.one, 1, "Should be able to read field");
@ -168,9 +171,8 @@ addLoadEvent(function() {
}
is(found, true, "Enumeration is broken");
is(d["twenty-one"], 21, "Should be 21");
});
addLoadEvent(SimpleTest.finish);
SimpleTest.finish();
}
]]>
</script>
</pre>

View File

@ -4,8 +4,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=397934
-->
<head>
<title>Test for Bug 397934</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<bindings xmlns="http://www.mozilla.org/xbl">
<binding id="ancestor">
<implementation>
@ -59,8 +57,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=397934
<![CDATA[
/** Test for Bug 397934 **/
SimpleTest.waitForExplicitFinish();
addLoadEvent(function() {
SimpleTest = parent.SimpleTest;
ok = parent.ok;
is = parent.is;
$ = function(x) { return document.getElementById(x); }
window.onload = function() {
var d;
d = $("display1");
is(d.storage, window,
@ -105,8 +106,8 @@ addLoadEvent(function() {
"test2" + ": Undefined field should override ancestor binding");
is(typeof(d.testAncestor), "undefined",
"test2" + ": Undefined field should really override ancestor binding");
});
addLoadEvent(SimpleTest.finish);
SimpleTest.finish();
}
]]>
</script>

View File

@ -0,0 +1,34 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=372769
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 372769</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
// Embed the real test. It will take care of everything else.
function setup() {
SpecialPowers.pushPrefEnv({'set': [['dom.use_xbl_scopes_for_remote_xul', false]]}, go);
}
function go() {
$('ifr').setAttribute('src', 'file_bug372769.xhtml');
}
</script>
</head>
<body onload="setup();">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=372769">Mozilla Bug 372769</a>
<p id="display"></p>
<div id="content">
<iframe id="ifr"></iframe>
</div>
<pre id="test">
</pre>
</body>
</html>

View File

@ -0,0 +1,34 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=397934
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 397934</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
// Embed the real test. It will take care of everything else.
function setup() {
SpecialPowers.pushPrefEnv({'set': [['dom.use_xbl_scopes_for_remote_xul', false]]}, go);
}
function go() {
$('ifr').setAttribute('src', 'file_bug397934.xhtml');
}
</script>
</head>
<body onload="setup();">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=397934">Mozilla Bug 397934</a>
<p id="display"></p>
<div id="content">
<iframe id="ifr"></iframe>
</div>
<pre id="test">
</pre>
</body>
</html>