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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/webexposed/resources/global-constructors-attributes.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/webexposed/resources/global-constructors-attributes-worker.js
diff --git a/LayoutTests/webexposed/resources/global-constructors-attributes-worker.js b/LayoutTests/webexposed/resources/global-constructors-attributes-worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..d19284b798a11d1b345407db3aeacd1180b63aec
--- /dev/null
+++ b/LayoutTests/webexposed/resources/global-constructors-attributes-worker.js
@@ -0,0 +1,32 @@
+if (this.importScripts)
+ importScripts('../../fast/js/resources/js-test-pre.js');
+
+description("Test to ensure that global constructors in workers environment have the right attributes");
+
+function descriptorShouldBe(object, property, expected) {
+ var test = "Object.getOwnPropertyDescriptor(" + object + ", " + property + ")";
+ if ("writable" in expected) {
+ shouldBe(test + ".value", "" + expected.value);
+ shouldBeFalse(test + ".hasOwnProperty('get')");
+ shouldBeFalse(test + ".hasOwnProperty('set')");
+ } else {
+ shouldBe(test + ".get", "" + expected.get);
+ shouldBe(test + ".set", "" + expected.set);
+ shouldBeFalse(test + ".hasOwnProperty('value')");
+ shouldBeFalse(test + ".hasOwnProperty('writable')");
+ }
+ shouldBe(test + ".enumerable", "" + expected.enumerable);
+ shouldBe(test + ".configurable", "" + expected.configurable);
+}
+
+var global = this;
+
+descriptorShouldBe("global", "'DataView'", {writable: true, enumerable: false, configurable: true, value:"DataView"});
+descriptorShouldBe("global", "'EventSource'", {writable: true, enumerable: false, configurable: true, value:"EventSource"});
+descriptorShouldBe("global", "'FileReaderSync'", {writable: true, enumerable: false, configurable: true, value:"FileReaderSync"});
+descriptorShouldBe("global", "'Float64Array'", {writable: true, enumerable: false, configurable: true, value:"Float64Array"});
+descriptorShouldBe("global", "'MessageChannel'", {writable: true, enumerable: false, configurable: true, value:"MessageChannel"});
+descriptorShouldBe("global", "'WorkerLocation'", {writable: true, enumerable: false, configurable: true, value:"WorkerLocation"});
+descriptorShouldBe("global", "'XMLHttpRequest'", {writable: true, enumerable: false, configurable: true, value:"XMLHttpRequest"});
+
+finishJSTest();
« 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