import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo

This commit is contained in:
Roy Tam 2018-01-19 03:59:58 +08:00
commit dcd9973243
150858 changed files with 23884658 additions and 0 deletions

View file

@ -0,0 +1,29 @@
<!--
onmessage = function(e) {
postMessage(1);
throw new Error();
}
close();
/*
-->
<!doctype html>
<title>close() and incoming message</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
var worker = new Worker('#');
worker.onmessage = function(e) {
assert_unreached("Got message");
};
worker.onerror = function(e) {
assert_unreached("Got error");
};
worker.postMessage(1);
setTimeout(done, 2000);
</script>
<!--
*/
//-->

View file

@ -0,0 +1,27 @@
<!--
postMessage(1);
close();
postMessage(2);
/*
-->
<!doctype html>
<title>close() and sending messages</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function() {
var worker = new Worker('#');
var i = 0;
worker.onmessage = this.step_func(function(e) {
i++;
assert_equals(e.data, i);
if (i == 2) {
this.done();
}
});
});
</script>
<!--
*/
//-->

View file

@ -0,0 +1,34 @@
<!--
var interval1 = setInterval(function() {
clearInterval(interval1);
postMessage(1);
throw new Error();
}, 10);
close();
var interval2 = setInterval(function() {
clearInterval(interval2);
postMessage(1);
throw new Error();
}, 10);
/*
-->
<!doctype html>
<title>close() and setInterval</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
var worker = new Worker('#');
worker.onmessage = function(e) {
assert_unreached("Got message");
};
worker.onerror = function(e) {
assert_unreached("Got error");
};
setTimeout(done, 2000);
</script>
<!--
*/
//-->

View file

@ -0,0 +1,28 @@
<!--
function x() {
postMessage(1);
throw new Error();
}
setTimeout(x, 0);
close();
setTimeout(x, 0);
/*
-->
<!doctype html>
<title>close() and setTimeout</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
var worker = new Worker('#');
worker.onmessage = function(e) {
assert_unreached("Got message");
};
worker.onerror = function(e) {
assert_unreached("Got error");
};
setTimeout(done, 2000);
</script>
<!--
*/
//-->

View file

@ -0,0 +1,3 @@
def main(request, response):
response.status = 302
response.headers.append("Location", "post-location-members.js?a")

View file

@ -0,0 +1,31 @@
<!--
postMessage([null, location.href, location.protocol, location.host,
location.hostname, location.port, location.pathname,
location.search, location.hash]);
/*
-->
<!doctype html>
<title>members of WorkerLocation</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function() {
var worker = new Worker('#');
worker.onmessage = this.step_func(function(e) {
assert_equals(e.data[0], null);
assert_equals(e.data[1], location.href + '#', 'href');
assert_equals(e.data[2], location.protocol, 'protocol');
assert_equals(e.data[3], location.host, 'host');
assert_equals(e.data[4], location.hostname, 'hostname');
assert_equals(e.data[5], location.port, 'port');
assert_equals(e.data[6], location.pathname, 'pathname');
assert_equals(e.data[7], location.search, 'search');
assert_equals(e.data[8], '', 'hash');
this.done();
});
});
</script>
<!--
*/
//-->

View file

@ -0,0 +1,8 @@
postMessage([location.href,
location.protocol,
location.host,
location.hostname,
location.port,
location.pathname,
location.search,
location.hash]);

View file

@ -0,0 +1,28 @@
<!--
/*
-->
<!doctype html>
<title>location with a worker in separate file that redirects</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function() {
var worker = new Worker('helper-redirect.py?fail');
worker.onmessage = this.step_func_done(function(e) {
assert_equals(e.data[0], location.href.replace(/\/[^\/]+$/, '/post-location-members.js?a'));
assert_equals(e.data[1], location.protocol);
assert_equals(e.data[2], location.host);
assert_equals(e.data[3], location.hostname);
assert_equals(e.data[4], location.port);
assert_equals(e.data[5], location.pathname.replace(/\/[^\/]+$/, '/post-location-members.js'));
assert_equals(e.data[6], '?a');
assert_equals(e.data[7], '');
});
});
</script>
<!--
*/
//-->

View file

@ -0,0 +1,21 @@
<!--
postMessage(location === location);
/*
-->
<!doctype html>
<title>location === location</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function() {
var worker = new Worker('#');
worker.onmessage = this.step_func(function(e) {
assert_true(e.data);
this.done();
});
});
</script>
<!--
*/
//-->

View file

@ -0,0 +1,43 @@
<!--
var exceptions = [];
try { location.href = 1; } catch(e) { exceptions.push('href'); }
try { location.protocol = 1; } catch(e) { exceptions.push('protocol'); }
try { location.host = 1; } catch(e) { exceptions.push('host'); }
try { location.hostname = 1; } catch(e) { exceptions.push('hostname');}
try { location.port = 1; } catch(e) { exceptions.push('port'); }
try { location.pathname = 1; } catch(e) { exceptions.push('pathname'); }
try { location.search = 1; } catch(e) { exceptions.push('search'); }
try { location.hash = 1; } catch(e) { exceptions.push('hash'); }
postMessage([null, location.href, location.protocol, location.host,
location.hostname, location.port, location.pathname,
location.search, location.hash, exceptions]);
/*
-->
<!doctype html>
<title>setting members of WorkerLocation</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function() {
var worker = new Worker('#');
worker.onmessage = this.step_func(function(e) {
assert_equals(e.data[0], null);
assert_equals(e.data[1], location.href + '#', 'href');
assert_equals(e.data[2], location.protocol, 'protocol');
assert_equals(e.data[3], location.host, 'host');
assert_equals(e.data[4], location.hostname, 'hostname');
assert_equals(e.data[5], location.port, 'port');
assert_equals(e.data[6], location.pathname, 'pathname');
assert_equals(e.data[7], location.search, 'search');
assert_equals(e.data[8], '', 'hash');
assert_array_equals(e.data[9], [], 'number of exceptions');
this.done();
});
});
</script>
<!--
*/
//-->

View file

@ -0,0 +1,28 @@
<!--
/*
-->
<!doctype html>
<title>location with a worker in separate file</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function() {
var worker = new Worker('post-location-members.js?a#b?c');
worker.onmessage = this.step_func(function(e) {
assert_equals(e.data[0], location.href.replace(/\/[^\/]+$/, '/post-location-members.js?a#b?c'));
assert_equals(e.data[1], location.protocol);
assert_equals(e.data[2], location.host);
assert_equals(e.data[3], location.hostname);
assert_equals(e.data[4], location.port);
assert_equals(e.data[5], location.pathname.replace(/\/[^\/]+$/, '/post-location-members.js'));
assert_equals(e.data[6], '?a');
assert_equals(e.data[7], '#b?c');
this.done();
});
});
</script>
<!--
*/
//-->

View file

@ -0,0 +1,32 @@
<!--
onerror = function(a, b, c, d) {
y(); // the error is "not handled"
}
function x() {
y();
}
x();
/*
-->
<!doctype html>
<title>onerror, "not handled" with an error in the onerror function</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function() {
var worker = new Worker('#');
worker.onerror = this.step_func(function(e) {
assert_true(e instanceof ErrorEvent, 'e instanceof ErrorEvent');
assert_equals(typeof e.message, 'string', 'typeof e.message');
assert_equals(e.filename, document.URL+'#', 'e.filename');
assert_equals(typeof e.lineno, 'number', 'typeof e.lineno');
assert_equals(typeof e.colno, 'number', 'typeof e.column');
e.preventDefault(); // "handled"
this.done();
});
});
</script>
<!--
*/
//-->

View file

@ -0,0 +1,36 @@
<!--
onerror = function(a, b, c, d) {
postMessage([a, b, c, d]);
return true; // the error is "handled"
}
function x() {
y();
}
x();
/*
-->
<!doctype html>
<title>onerror, "handled"</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function() {
var worker = new Worker('#');
worker.onmessage = this.step_func(function(e) {
assert_equals(typeof e.data[0], 'string', 'first argument');
assert_equals(e.data[1], document.URL+'#', 'second argument');
assert_equals(typeof e.data[2], 'number', 'third argument');
assert_equals(typeof e.data[3], 'number', 'fourth argument');
setTimeout(this.step_func(function() {
this.done();
}), 100);
});
worker.onerror = this.step_func(function(e) {
assert_unreached();
});
});
</script>
<!--
*/
//-->

View file

@ -0,0 +1,32 @@
<!--
onerror = function(a, b, c, d) {
return false; // the error is "not handled"
}
function x() {
y();
}
x();
/*
-->
<!doctype html>
<title>onerror, "not handled"</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function() {
var worker = new Worker('#');
worker.onerror = this.step_func(function(e) {
assert_true(e instanceof ErrorEvent, 'e instanceof ErrorEvent');
assert_equals(typeof e.message, 'string', 'typeof e.message');
assert_equals(e.filename, document.URL+'#', 'e.filename');
assert_equals(typeof e.lineno, 'number', 'typeof e.lineno');
assert_equals(typeof e.colno, 'number', 'typeof e.column');
e.preventDefault(); // "handled"
this.done();
});
});
</script>
<!--
*/
//-->

View file

@ -0,0 +1,31 @@
<!--
function x() {
y();
}
x();
/*
-->
<!doctype html>
<title>onerror, "not handled" with only window.onerror defined</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() {
var worker = new Worker('#');
window.onerror = this.step_func(function(a, b, c, d) {
assert_equals(typeof a, 'string', 'first argument');
assert_equals(b, document.URL+'#', 'second argument');
assert_equals(typeof c, 'number', 'third argument');
assert_equals(typeof d, 'number', 'fourth argument');
this.done();
return true; // "handled"
});
});
</script>
<!--
*/
//-->

View file

@ -0,0 +1,39 @@
<!--
var results = [];
function check(func, msg) {
try {
results.push([func(), msg]);
} catch(ex) {
results.push([String(ex), msg]);
}
}
check(function() { return self === self; }, 'self === self');
check(function() { return self instanceof WorkerGlobalScope; }, 'self instanceof WorkerGlobalScope');
check(function() { return 'self' in self; }, '\'self\' in self');
check(function() {
var x = self;
self = 1;
return x === self;
}, 'self = 1');
postMessage(results);
/*
-->
<!doctype html>
<title>self</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function() {
var worker = new Worker('#');
worker.onmessage = this.step_func(function(e) {
for (var i = 0; i < e.data.length; ++i) {
assert_true(e.data[i][0], e.data[i][1]);
}
this.done();
});
});
</script>
<!--
*/
//-->