From 1e9651e5e321a1908bee8eee18559422cd7f9526 Mon Sep 17 00:00:00 2001 From: Peter Van der Beken Date: Wed, 9 Jul 2014 16:58:04 +0200 Subject: [PATCH] Bug 1040391 - Fix test_bug440572.html to not rely on silent failure to pass. r=bz. --HG-- extra : rebase_source : e789431a476d5b96109772084b9ce6efe4da31a6 --- dom/tests/mochitest/bugs/iframe_bug440572.html | 4 ++-- dom/tests/mochitest/bugs/test_bug440572.html | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dom/tests/mochitest/bugs/iframe_bug440572.html b/dom/tests/mochitest/bugs/iframe_bug440572.html index 8a2fdce05bd..c8d9f8fe296 100644 --- a/dom/tests/mochitest/bugs/iframe_bug440572.html +++ b/dom/tests/mochitest/bugs/iframe_bug440572.html @@ -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");

Move on, nothing to see here...

diff --git a/dom/tests/mochitest/bugs/test_bug440572.html b/dom/tests/mochitest/bugs/test_bug440572.html index db6e4a8f373..a86f141374a 100644 --- a/dom/tests/mochitest/bugs/test_bug440572.html +++ b/dom/tests/mochitest/bugs/test_bug440572.html @@ -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(); }