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

Unified Diff: LayoutTests/fast/dom/global-constructors-listing.html

Issue 14705010: Add test case that documents all global constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 | « no previous file | LayoutTests/fast/dom/global-constructors-listing-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/global-constructors-listing.html
diff --git a/LayoutTests/fast/dom/global-constructors-listing.html b/LayoutTests/fast/dom/global-constructors-listing.html
new file mode 100644
index 0000000000000000000000000000000000000000..35a6397c3325d928087819d570bb8d5e004ec62c
--- /dev/null
+++ b/LayoutTests/fast/dom/global-constructors-listing.html
@@ -0,0 +1,27 @@
+<html>
+<body>
+<script src="../js/resources/js-test-pre.js"></script>
+<script>
+description("This test documents the Constructor properties on the global window object.");
+
+function isConstructor(propertyName) {
+ var descriptor = Object.getOwnPropertyDescriptor(window, propertyName);
+ if (descriptor.value == undefined || descriptor.value.prototype == undefined)
+ return false;
+ return descriptor.writable && !descriptor.enumerable && descriptor.configurable;
+}
+
+var constructorNames = [];
+var propertyNames = Object.getOwnPropertyNames(window);
+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]);
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/global-constructors-listing-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698