Revision cb8b86ba657eb03160aed1e528f07a33bbc6ca26 authored by Mike West on 28 August 2015, 05:14:24 UTC, committed by Mike West on 28 August 2015, 05:14:24 UTC
use standard b64 encoding as per spec, not b64url
2 parent s 20eb289 + a18bca8
Raw File
001.html
<!--
var port;
var timeout;
onerror = function(a,b,c,d,e) {
  // will return undefined, thus the error is "not handled"
  // so error should be reported to the user, but this test doesn't check
  // that.
  // just make sure that this method is invoked with five arguments
  clearTimeout(timeout);
  var log = '';
  if (arguments.length != 5)
    log += 'got ' + arguments.length + ' arguments, expected 5. ';
  if (typeof a != 'string')
    log += 'first argument wasn\'t a string. ';
  if (b != location.href)
    log += 'second argument was ' + b + ', expected ' + location.href + '. ';
  if (typeof c != 'number')
    log += 'third argument wasn\'t a number. ';
  if (typeof d != 'number')
    log += 'fourth argument wasn\'t a number. ';
  if (e != 42)
    log += 'fifth argument wasn\'t the thrown exception. ';
  port.postMessage(log);
}
onconnect = function (e) {
  port = e.ports[0];
  timeout = setTimeout(function() { port.postMessage('self.onerror was not invoked'); }, 250);
  throw 42; // will "report the error"
}


/*
-->
<!doctype html>
<title>shared worker, not handled</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
setup({allow_uncaught_exception:true});
async_test(function() {
  window.onerror = this.step_func(function(a) {
    assert_unreached('window.onerror invoked: ' + a);
  });
  var worker = new SharedWorker('#', '');
  worker.port.onmessage = this.step_func_done(function(e) {
    assert_equals(e.data, '');
  });
});
</script>
<!--
*/
//-->
back to top