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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/resources/global-interface-listing-worklet.js

Issue 2889423003: Unify webexposed/global-interface-listing scripts (Closed)
Patch Set: Rebased Created 3 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
OLDNEW
1 /* Adopted from LayoutTests/webexposed/resources/global-interface-listing.js */ 1 /* Adopted from LayoutTests/resources/global-interface-listing.js */
2 2
3 // Run all the code in a local scope. 3 // Run all the code in a local scope.
4 (function() { 4 (function() {
5 5
6 // Generally, Worklet should not have a reference to the global object. 6 // Generally, Worklet should not have a reference to the global object.
7 // https://drafts.css-houdini.org/worklets/#code-idempotency 7 // https://drafts.css-houdini.org/worklets/#code-idempotency
8 if (this) { 8 if (this) {
9 console.error('"this" should not refer to the global object'); 9 console.error('"this" should not refer to the global object');
10 return; 10 return;
11 } 11 }
12 // Instead, retrieve the global object in a tricky way. 12 // Instead, retrieve the global object in a tricky way.
13 var global_object = Function('return this')(); 13 var global_object = Function('return this')();
14 14
15 var globals = []; 15 var globals = [];
16 16
17 // List of builtin JS constructors; Blink is not controlling what properties the se 17 // List of builtin JS constructors; Blink is not controlling what properties the se
18 // objects have, so exercising them in a Blink test doesn't make sense. 18 // objects have, so exercising them in a Blink test doesn't make sense.
19 // 19 //
20 // This list should be kept in sync with the one at LayoutTests/webexposed/resou rces/global-interface-listing.js 20 // This list should be kept in sync with the one at LayoutTests/resources/global -interface-listing.js
21 var js_builtins = new Set([ 21 var js_builtins = new Set([
22 'Array', 22 'Array',
23 'ArrayBuffer', 23 'ArrayBuffer',
24 'Boolean', 24 'Boolean',
25 'Date', 25 'Date',
26 'Error', 26 'Error',
27 'EvalError', 27 'EvalError',
28 'Float32Array', 28 'Float32Array',
29 'Float64Array', 29 'Float64Array',
30 'Function', 30 'Function',
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 }); 141 });
142 globals.push.apply(globals, property_strings.sort()); 142 globals.push.apply(globals, property_strings.sort());
143 143
144 // Worklets don't have a mechanism to communicate back to the main page, dump 144 // Worklets don't have a mechanism to communicate back to the main page, dump
145 // results into the console. 145 // results into the console.
146 globals.forEach(function(global) { 146 globals.forEach(function(global) {
147 console.log(global); 147 console.log(global);
148 }); 148 });
149 149
150 })(); // Run all the code in a local scope. 150 })(); // Run all the code in a local scope.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698