summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/workers/constructor-proto.html
blob: e8c7873a19de5308908f8db3c109370c24a27037 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html>
<script src="../js/resources/js-test-pre.js"></script>
<script src="resources/worker-create-common.js"></script>
<script>

var jsTestIsAsync = true;

description('This tests that setting the proto of a built in constructor is not reset');

var worker = createWorker();
worker.postMessage("eval proto = new Number(42)");
worker.postMessage("eval Object.getPrototypeOf(WorkerLocation)");
worker.postMessage("eval WorkerLocation.__proto__ = proto");
worker.postMessage("eval Object.getPrototypeOf(WorkerLocation)");
worker.postMessage("eval DONE");

worker.onmessage = function(evt) {
    if (!/DONE/.test(evt.data))
        debug(evt.data.replace(new RegExp("/.*LayoutTests"), "<...>"));
    else
        finishJSTest();
};

</script>
<script src="../js/resources/js-test-post.js"></script>