dom/tests/mochitest/bugs/test_bug1171215.html
author Andrea Marchesini <amarchesini@mozilla.com>
Fri, 08 Mar 2019 09:03:15 +0000
changeset 463124 98ff0248c6079b9518e2b96d19bacb5402a21bda
parent 462908 ca64604d4b781aa8191144e97b660ae3b09fae6e
child 469658 ba6f655fd68963530c866d0d4a48c3db3d307777
permissions -rw-r--r--
Bug 1525245 - Stabilize cookiePolicy/cookiePermission for live documents - part 10 - Fix existing tests, r=Ehsan Differential Revision: https://phabricator.services.mozilla.com/D18958

<!DOCTYPE html>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1022869
-->
<head>
  <meta charset="utf-8">
  <title>Test for Bug 1022869</title>
  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  <script type="text/javascript">

  SimpleTest.waitForExplicitFinish();

  /** Test for Bug 1022869 **/
  function startTest() {
    // Initialize our cookie.
    document.cookie = "a=b";

    SpecialPowers.pushPrefEnv({ set: [["network.cookie.cookieBehavior", 1]] }).then(_ => {
      let w = window.open("window_bug1171215.html");
      onmessage = e => {
        if (e.data.type == "finish") {
          w.close();
          SimpleTest.finish();
          return;
        }

        if (e.data.type == "info") {
          info(e.data.msg);
          return;
        }

        if (e.data.type == "test") {
          ok(e.data.test, e.data.msg);
          return;
        }

        ok(false, "Unknown message");
      };
    });
  }
  </script>
</head>
<body onload="startTest()">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1022869">Mozilla Bug 1022869</a>
</body>
</html>