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

Unified Diff: LayoutTests/http/tests/serviceworker/webexposed/resources/global-interface-listing-worker.js

Issue 1289753005: ServiceWorker webexposed tests should skip JS builtins (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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
Index: LayoutTests/http/tests/serviceworker/webexposed/resources/global-interface-listing-worker.js
diff --git a/LayoutTests/http/tests/serviceworker/webexposed/resources/global-interface-listing-worker.js b/LayoutTests/http/tests/serviceworker/webexposed/resources/global-interface-listing-worker.js
index 1c5b024d03ea75f87041035b8122d55682ea66c4..8e0881b879f9af4aaa09fb02ef112fd044feb8c7 100644
--- a/LayoutTests/http/tests/serviceworker/webexposed/resources/global-interface-listing-worker.js
+++ b/LayoutTests/http/tests/serviceworker/webexposed/resources/global-interface-listing-worker.js
@@ -2,7 +2,47 @@
var globals = [];
-function is_constructor(property_name) {
+// List of builtin JS constructors; Blink is not controlling what properties these
+// objects have, so exercising them in a Blink test doesn't make sense.
+//
+// This list should be kept in sync with the one at LayoutTests/webexposed/resources/global-interface-listing.js
+var js_builtins = new Set([
+ 'Array',
+ 'ArrayBuffer',
+ 'Boolean',
+ 'Date',
+ 'Error',
+ 'EvalError',
+ 'Float32Array',
+ 'Float64Array',
+ 'Function',
+ 'Int16Array',
+ 'Int32Array',
+ 'Int8Array',
+ 'Map',
+ 'Number',
+ 'Object',
+ 'Promise',
+ 'RangeError',
+ 'ReferenceError',
+ 'RegExp',
+ 'Set',
+ 'String',
+ 'Symbol',
+ 'SyntaxError',
+ 'TypeError',
+ 'Uint16Array',
+ 'Uint32Array',
+ 'Uint8Array',
+ 'Uint8ClampedArray',
+ 'URIError',
+ 'WeakMap',
+ 'WeakSet',
+]);
+
+function is_web_idl_constructor(property_name) {
+ if (js_builtins.has(property_name))
+ return false;
var descriptor = Object.getOwnPropertyDescriptor(this, property_name);
if (descriptor.value === undefined ||
descriptor.value.prototype === undefined) {
@@ -12,7 +52,7 @@ function is_constructor(property_name) {
descriptor.configurable;
}
-var interface_names = Object.getOwnPropertyNames(this).filter(is_constructor);
+var interface_names = Object.getOwnPropertyNames(this).filter(is_web_idl_constructor);
interface_names.sort();
interface_names.forEach(function(interface_name) {
globals.push('interface ' + interface_name);

Powered by Google App Engine
This is Rietveld 408576698