dom/tests/mochitest/sessionstorage/interOriginSlave.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 function postMsg(message)
     2 {
     3   opener.postMessage(message, "http://mochi.test:8888");
     4 }
     6 window.addEventListener("message", onMessageReceived, false);
     8 function onMessageReceived(event)
     9 {
    10   //alert("slave got event: "+event.data);
    11   if (event.data == "step") {
    12     if (doStep())
    13       postMsg("perf");
    15     return;
    16   }
    18   postMsg("Invalid message");
    19 }
    21 function ok(a, message)
    22 {
    23   if (!a)
    24     postMsg("FAILURE: " + message);
    25   else
    26     postMsg(message);
    27 }
    29 function is(a, b, message)
    30 {
    31   if (a != b)
    32     postMsg("FAILURE: " + message + ", expected "+b+" got "+a);
    33   else
    34     postMsg(message + ", expected "+b+" got "+a);
    35 }
    37 function finishTest()
    38 {
    39   sessionStorage.clear();
    40   postMsg("done");
    41   return false;
    42 }

mercurial