Bug 1040391 - Fix test_bug440572.html to not rely on silent failure to pass. r=bz.

--HG--
extra : rebase_source : e789431a476d5b96109772084b9ce6efe4da31a6
This commit is contained in:
Peter Van der Beken 2014-07-09 16:58:04 +02:00
parent 7f14efdcb3
commit 1e9651e5e3
2 changed files with 6 additions and 5 deletions

View File

@ -6,11 +6,11 @@ var success = 0;
try {
parent[name].success = 1;
parent.postMessage(success ? "success" : "failure", "http://mochi.test:8888");
} catch (e) {
parent.postMessage(e, "http://mochi.test:8888");
parent.postMessage(e.toString(), "http://mochi.test:8888");
}
parent.postMessage(success ? "success" : "failure", "http://mochi.test:8888");
</script>
<p>Move on, nothing to see here...</p>
</body>

View File

@ -27,9 +27,10 @@ window.addEventListener("message", receiveMessage, false);
function runtests()
{
for (i in messages) {
is(messages[i], "success", "test in frame failed.");
}
is(messages.length, 3, "received the right number of messages.");
is(messages[0], "success", "test in frame failed.");
isnot(messages[1], "success", "parent[\"content\"] should be the WebIDL property of Window.");
isnot(messages[2], "success", "parent[\"dump\"] should be the WebIDL property of Window.");
SimpleTest.finish();
}