Bug 833208 (part 5) - Remove e4x support from mochitests. r=jorendorff.

--HG--
extra : rebase_source : a88f8ed13299c566df2297729b3a5ddf21fcaafa
This commit is contained in:
Nicholas Nethercote 2013-01-28 14:55:17 -08:00
parent d0f259110b
commit 9987ec3eb4
3 changed files with 2 additions and 93 deletions

View File

@ -51,6 +51,7 @@ MOCHITEST_FILES = chrome_wrappers_helper.html \
bug589028_helper.html \
test_bug601299.html \
test_bug605167.html \
test_bug618017.html \
test_bug623437.html \
test_bug628410.html \
test_bug628794.html \
@ -92,12 +93,5 @@ MOCHITEST_FILES = chrome_wrappers_helper.html \
test_bug809547.html \
$(NULL)
ifneq ($(OS_TARGET),Android)
ifndef MOZ_PLATFORM_MAEMO
MOCHITEST_FILES += test_bug564330.html \
test_bug618017.html
endif
endif
include $(topsrcdir)/config/rules.mk

View File

@ -1,58 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=564330
-->
<head>
<title>Test for Bug 560351</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=564330">Mozilla Bug 564330</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
function getAllowXML(){
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
Components.utils.import("resource://gre/modules/Services.jsm");
return Services.prefs.getBoolPref("javascript.options.xml.content");
}
function setAllowXML(value){
// Set the value for e4x
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
Components.utils.import("resource://gre/modules/Services.jsm");
Services.prefs.setBoolPref("javascript.options.xml.content", value);
}
// Save the initial preference
var default_allow_xml = getAllowXML();
function restoreAllowXML(){
setAllowXML(default_allow_xml);
}
setAllowXML(true);
</script>
<script>
/** Test for Bug 564330 **/
var pass = false;
try {
document.createElement("span").setUserData("x", eval('<y/>'), null);
} catch (e) {
pass = true;
}
</script>
<script>
ok(pass, "pass was set to true");
restoreAllowXML();
</script>
</pre>
</body>
</html>

View File

@ -11,29 +11,6 @@ Parsing XML must not override the version.
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<script type='application/javascript;version=1.5'>
function getAllowXML(){
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
Components.utils.import("resource://gre/modules/Services.jsm");
return Services.prefs.getBoolPref("javascript.options.xml.content");
}
function setAllowXML(value){
// Set the value for e4x
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
Components.utils.import("resource://gre/modules/Services.jsm");
Services.prefs.setBoolPref("javascript.options.xml.content", value);
}
// Save the initial preference
var default_allow_xml = getAllowXML();
function restoreAllowXML(){
setAllowXML(default_allow_xml);
}
setAllowXML(true);
var uneval_xml = uneval(eval('<test />'));
</script>
<script type='application/javascript;version=1.7'>
let x = 12;
@ -43,13 +20,9 @@ function doLetEval() {
</script>
<script type='application/javascript;version=1.5'>
ok(uneval_xml === '<test/>', 'xml can be parsed in any version');
doLetEval(); // Call to a function with a different version.
</script>
<script type='application/javascript;version=1.5'>
restoreAllowXML();
</script>
</body>
</html>