dom/base/test/test_bug1081686.html
author Nicholas Nethercote <nnethercote@mozilla.com>
Mon, 05 Oct 2015 16:59:32 -0700
changeset 301715 3897da20e42dec0bcf73987af1eaac4f8ce950b8
parent 246964 fa8bd3194aca6a90360994c17869845f7b7da5ac
permissions -rw-r--r--
Bug 1211324 (part 3) - Remove GraphicsFilter::FILTER_FAST and replace it with FILTER_BEST. r=mattwoodrow. This may sound like an odd change but it's what the current code effectively already does due to the way ToFilter() and ThebesFilter() are defined.

<!DOCTYPE HTML>
<html>
<!--
-->
<head>
  <title>bug 1081686</title>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="testWebSocket()">
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script class="testbody" type="text/javascript">

var ws;

function forcegc()
{
  SpecialPowers.forceGC();
  SpecialPowers.gc();
  setTimeout(function()
  {
    SpecialPowers.gc();
  }, 0);
}

function testWebSocket () {
  ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/file_websocket_hello");
  ws.onopen = function(e) {
    ws.send("data");
  }
  ws.onclose = function(e) {
    forcegc();
    setTimeout(function() {
      is(ws.readyState, 3, 'WebSocket is closed');
      is(ws.bufferedAmount, 0, 'WebSocket.bufferedAmount should be empty.');
      is(ws.binaryType, 'blob', 'WebSocket.binaryType is blob');
      ws.binaryType = 'arraybuffer';
      is(ws.binaryType, 'arraybuffer', 'WebSocket.binaryType is arraybuffer');
      is(ws.url, 'ws://mochi.test:8888/tests/dom/base/test/file_websocket_hello', 'WebSocket.url is correct');
      ws.close();
      ws.send('foobar');
      SimpleTest.finish();
    }, 1000);
  }

  ws.onerror = function(e) {
    ok(false, "onerror called!");
    SimpleTest.finish();
  }
  ws.onmessage = function(e) {
    is(e.data, "Hello world!", "Wrong data");
    ws.close();
  }
}

SimpleTest.waitForExplicitFinish();
SimpleTest.requestFlakyTimeout("untriaged");

</script>
</pre>
<div>


</div>


</body>
</html>