1 if (this.importScripts)
2 importScripts('../../resources/js-test.js');
4 description("Test to ensure that global constructors in workers environment have the right attributes");
6 function descriptorShouldBe(object, property, expected) {
7 var test = "Object.getOwnPropertyDescriptor(" + object + ", " + property + ")";
8 if ("writable" in expected) {
9 shouldBe(test + ".value", "" + expected.value);
10 shouldBeFalse(test + ".hasOwnProperty('get')");
11 shouldBeFalse(test + ".hasOwnProperty('set')");
13 shouldBe(test + ".get", "" + expected.get);
14 shouldBe(test + ".set", "" + expected.set);
15 shouldBeFalse(test + ".hasOwnProperty('value')");
16 shouldBeFalse(test + ".hasOwnProperty('writable')");
18 shouldBe(test + ".enumerable", "" + expected.enumerable);
19 shouldBe(test + ".configurable", "" + expected.configurable);
24 descriptorShouldBe("global", "'DataView'", {writable: true, enumerable: false, configurable: true, value:"DataView"});
25 descriptorShouldBe("global", "'EventSource'", {writable: true, enumerable: false, configurable: true, value:"EventSource"});
26 descriptorShouldBe("global", "'FileReaderSync'", {writable: true, enumerable: false, configurable: true, value:"FileReaderSync"});
27 descriptorShouldBe("global", "'Float64Array'", {writable: true, enumerable: false, configurable: true, value:"Float64Array"});
28 descriptorShouldBe("global", "'MessageChannel'", {writable: true, enumerable: false, configurable: true, value:"MessageChannel"});
29 descriptorShouldBe("global", "'WorkerLocation'", {writable: true, enumerable: false, configurable: true, value:"WorkerLocation"});
30 descriptorShouldBe("global", "'XMLHttpRequest'", {writable: true, enumerable: false, configurable: true, value:"XMLHttpRequest"});