dom/permission/tests/test_tcp-socket.html
author Phil Ringnalda <philringnalda@gmail.com>
Sat, 17 Jan 2015 13:26:10 -0800
changeset 253203 0c454540fc2b709e1b32456be700ebcfa8713093
parent 253193 9ede577f5ada3f664d7a9bc13d2f617901349e00
child 297758 bf8d9233a7bd5ea2e7a1a7916dd1a28021bca7f8
permissions -rw-r--r--
Back out 3 changesets (bug 885982, bug 1118063) for b2g mochitest-6 bustage CLOSED TREE Backed out changeset 865e7bc208df (bug 885982) Backed out changeset 9ede577f5ada (bug 885982) Backed out changeset 6ccc86f7429e (bug 1118063)

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=815105
-->
<head>
  <meta charset="utf-8">
  <title>Test for Bug 815105 </title>
  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=815105">Mozilla Bug 815105 </a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
<script type="application/javascript;version=1.8" src="file_framework.js"></script>
<script type="application/javascript;version=1.8">
/* mozTCPSocket only returns null on window init
 * if the permission isn't set
 */
function verifier(success, failure) {
  try {
    var conn = this.getObj().open("http://mochi.test/", 80);

    if (conn) {
      success("Opened connection");
    } else {
      failure("failed to open connection");
    }
  } catch (e) {
    failure("Got an exception " + e);
  }
}

var gData = [
  {
    perm: ["tcp-socket"],
    needParentPerm: true,
    obj: "mozTCPSocket",
    idl: "nsIDOMTCPSocket",
    settings: [["dom.mozTCPSocket.enabled", true]],
    verifier: verifier.toSource(),
  }
]
</script>
</pre>
</body>
</html>