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

Unified Diff: LayoutTests/webexposed/resources/global-context-constructors-listing.js

Issue 15879005: Add webexposed/ layout test that documents all the global constructors in the Worker context (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Share more code with global-constructors-listing.html Created 7 years, 7 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/global-constructors-listing-worker-expected.txt ('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-context-constructors-listing.js
diff --git a/LayoutTests/webexposed/resources/global-context-constructors-listing.js b/LayoutTests/webexposed/resources/global-context-constructors-listing.js
new file mode 100644
index 0000000000000000000000000000000000000000..193fa9698d7393702b8f6878d64d523985375c7e
--- /dev/null
+++ b/LayoutTests/webexposed/resources/global-context-constructors-listing.js
@@ -0,0 +1,24 @@
+if (this.importScripts)
+ importScripts('../../fast/js/resources/js-test-pre.js');
+
+function isConstructor(propertyName) {
+ var descriptor = Object.getOwnPropertyDescriptor(this, propertyName);
+ if (descriptor.value == undefined || descriptor.value.prototype == undefined)
+ return false;
+ return descriptor.writable && !descriptor.enumerable && descriptor.configurable;
+}
+
+var constructorNames = [];
+var propertyNames = Object.getOwnPropertyNames(this);
+for (var i = 0; i < propertyNames.length; i++) {
+ if (isConstructor(propertyNames[i]))
+ constructorNames[constructorNames.length] = propertyNames[i];
+}
+
+
+constructorNames.sort();
+for (var i = 0; i < constructorNames.length; i++)
+ debug(constructorNames[i]);
+
+if (isWorker())
+ finishJSTest();
« no previous file with comments | « LayoutTests/webexposed/global-constructors-listing-worker-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698