зеркало из https://github.com/mozilla/gecko-dev.git
Add a mochitest for bug 390001. r=sayrer sr=bzbarsky
This commit is contained in:
Родитель
3989bcdf70
Коммит
bc7aaf737e
|
@ -64,6 +64,11 @@ DIRS += mochitest \
|
|||
$(NULL)
|
||||
endif
|
||||
|
||||
ifdef MOZ_MOCHITEST
|
||||
DIRS += mochitest \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
ifdef ENABLE_TESTS
|
||||
XPCSHELL_TESTS = unit
|
||||
endif
|
||||
|
|
|
@ -45,6 +45,7 @@ include $(DEPTH)/config/autoconf.mk
|
|||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
_TEST_FILES = test_bug390488.html \
|
||||
test_xow.html \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_TEST_FILES)
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Tests Cross Origin Wrappers</title>
|
||||
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<script class="testbody" type="text/javascript;version=1.7">
|
||||
var answer = [];
|
||||
for (let i in location)
|
||||
answer.push(i);
|
||||
var expected = [
|
||||
"hash",
|
||||
"host",
|
||||
"hostname",
|
||||
"href",
|
||||
"pathname",
|
||||
"port",
|
||||
"protocol",
|
||||
"search",
|
||||
"reload",
|
||||
"replace",
|
||||
"assign"
|
||||
];
|
||||
|
||||
is(answer.sort().toString(),
|
||||
expected.sort().toString(),
|
||||
'enumeration does not work');
|
||||
|
||||
var origProto = window.__proto__;
|
||||
try {
|
||||
window.__proto__ = window;
|
||||
ok(false, 'cyclic proto value allowed');
|
||||
window.__proto__ = origProto;
|
||||
} catch (e) {
|
||||
is(e.toString(), 'Error: cyclic __proto__ value',
|
||||
'throw the right exception for a cyclic proto');
|
||||
is(window.__proto__, origProto, 'reset __proto__ after a cyclic proto');
|
||||
}
|
||||
|
||||
try {
|
||||
is('PASS', window.eval("'PASS'"), 'window.eval throws an exception');
|
||||
} catch (e) {
|
||||
ok(false, 'window.eval does not throw an exception');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче