Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(480)

Side by Side Diff: LayoutTests/webexposed/resources/global-constructors-attributes-worker.js

Issue 16528005: Add layout test to verify that global constructors in workers environment have right attributes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/webexposed/resources/global-constructors-attributes.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 if (this.importScripts)
2 importScripts('../../fast/js/resources/js-test-pre.js');
3
4 description("Test to ensure that global constructors in workers environment have the right attributes");
5
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')");
12 } else {
13 shouldBe(test + ".get", "" + expected.get);
14 shouldBe(test + ".set", "" + expected.set);
15 shouldBeFalse(test + ".hasOwnProperty('value')");
16 shouldBeFalse(test + ".hasOwnProperty('writable')");
17 }
18 shouldBe(test + ".enumerable", "" + expected.enumerable);
19 shouldBe(test + ".configurable", "" + expected.configurable);
20 }
21
22 var global = this;
23
24 descriptorShouldBe("global", "'DataView'", {writable: true, enumerable: false, c onfigurable: true, value:"DataView"});
25 descriptorShouldBe("global", "'EventSource'", {writable: true, enumerable: false , configurable: true, value:"EventSource"});
26 descriptorShouldBe("global", "'FileReaderSync'", {writable: true, enumerable: fa lse, configurable: true, value:"FileReaderSync"});
27 descriptorShouldBe("global", "'Float64Array'", {writable: true, enumerable: fals e, configurable: true, value:"Float64Array"});
28 descriptorShouldBe("global", "'MessageChannel'", {writable: true, enumerable: fa lse, configurable: true, value:"MessageChannel"});
29 descriptorShouldBe("global", "'WorkerLocation'", {writable: true, enumerable: fa lse, configurable: true, value:"WorkerLocation"});
30 descriptorShouldBe("global", "'XMLHttpRequest'", {writable: true, enumerable: fa lse, configurable: true, value:"XMLHttpRequest"});
31
32 finishJSTest();
OLDNEW
« no previous file with comments | « LayoutTests/webexposed/resources/global-constructors-attributes.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698