Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / js / script-tests / global-function-resolve.js
blobb2c8a27054437776b32d416f450d2e5094b5efc5
1 description("Test to make sure cached lookups on the global object are performed correctly.");
3 var functionNames = [
4 'addEventListener',
5 'alert',
6 'captureEvents',
7 'clearInterval',
8 'clearTimeout',
9 'clientInformation',
10 'close',
11 'closed',
12 'confirm',
13 'console',
14 'crypto',
15 'defaultStatus',
16 'defaultstatus',
17 'description',
18 'devicePixelRatio',
19 'dispatchEvent',
20 'document',
21 'getComputedStyle',
22 'getMatchedCSSRules',
23 'getSelection',
24 'history',
25 'innerHeight',
26 'innerWidth',
27 'location',
28 'locationbar',
29 'menubar',
30 'moveBy',
31 'moveTo',
32 'name',
33 'navigator',
34 'open',
35 'openDatabase',
36 'opener',
37 'outerHeight',
38 'outerWidth',
39 'pageXOffset',
40 'pageYOffset',
41 'parent',
42 'prompt',
43 'releaseEvents',
44 'removeEventListener',
45 'resizeBy',
46 'resizeTo',
47 'screen',
48 'screenLeft',
49 'screenTop',
50 'screenX',
51 'screenY',
52 'scroll',
53 'scrollBy',
54 'scrollTo',
55 'scrollX',
56 'scrollY',
57 'setInterval',
58 'setTimeout',
59 'status',
60 'stop',
61 'window',
64 var cachedFunctions = [];
65 for (var i = 0; i < functionNames.length; i++)
66 cachedFunctions[i] = new Function("return " + functionNames[i]);
68 for (var i = 0; i < functionNames.length; i++) {
69 shouldBe("cachedFunctions["+i+"]()", functionNames[i]);
70 shouldBe("cachedFunctions["+i+"]()", functionNames[i]);