toolkit/content/tests/chrome/test_about_networking.html

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 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=912103
     5 -->
     6 <head>
     7   <meta charset="utf-8">
     8   <title>Test for Bug </title>
     9   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    10   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
    11   <script type="application/javascript">
    13   SimpleTest.waitForExplicitFinish();
    15   function runTest() {
    16     const Cc = Components.classes;
    17     const Ci = Components.interfaces;
    19     var dashboard = Cc['@mozilla.org/network/dashboard;1']
    20                       .getService(Ci.nsIDashboard);
    21     dashboard.enableLogging = true;
    23     var wsURI = "ws://mochi.test:8888/chrome/toolkit/content/tests/chrome/file_about_networking";
    24     var websocket = new WebSocket(wsURI);
    26     websocket.addEventListener("open", function() {
    27       dashboard.requestWebsocketConnections(function(data) {
    28         var found = false;
    29         for (var i = 0; i < data.websockets.length; i++) {
    30           if (data.websockets[i].hostport == "mochi.test:8888") {
    31             found = true;
    32             break;
    33           }
    34         }
    35         isnot(found, false, "tested websocket entry not found");
    36         websocket.close();
    37         SimpleTest.finish();
    38       });
    39     });
    40   }
    42   window.addEventListener("DOMContentLoaded", function run() {
    43     window.removeEventListener("DOMContentLoaded", run);
    44     runTest();
    45   });
    47   </script>
    48 </head>
    49 <body>
    50 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=912103">Mozilla Bug </a>
    51 <p id="display"></p>
    52 <div id="content" style="display: none">
    54 </div>
    55 <pre id="test">
    56 </pre>
    57 </body>
    58 </html>

mercurial