OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var assertEq = chrome.test.assertEq; | 5 var assertEq = chrome.test.assertEq; |
6 var assertTrue = chrome.test.assertTrue; | 6 var assertTrue = chrome.test.assertTrue; |
7 var fail = chrome.test.fail; | 7 var fail = chrome.test.fail; |
8 var succeed = chrome.test.succeed; | 8 var succeed = chrome.test.succeed; |
9 | 9 |
10 function assertThrowsError(method, opt_expectedError) { | 10 function assertThrowsError(method, opt_expectedError) { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 assertEq('undefined', typeof(history.forward)); | 67 assertEq('undefined', typeof(history.forward)); |
68 assertEq('undefined', typeof(history.go)); | 68 assertEq('undefined', typeof(history.go)); |
69 assertEq('undefined', typeof(history.length)); | 69 assertEq('undefined', typeof(history.length)); |
70 assertEq('undefined', typeof(history.pushState)); | 70 assertEq('undefined', typeof(history.pushState)); |
71 assertEq('undefined', typeof(history.replaceState)); | 71 assertEq('undefined', typeof(history.replaceState)); |
72 assertEq('undefined', typeof(history.state)); | 72 assertEq('undefined', typeof(history.state)); |
73 succeed(); | 73 succeed(); |
74 }, | 74 }, |
75 | 75 |
76 function testWindowFind() { | 76 function testWindowFind() { |
77 assertEq('undefined', typeof(Window.prototype.find('needle'))); | 77 assertEq('undefined', typeof(Window.prototype.find)); |
78 assertEq('undefined', typeof(window.find('needle'))); | 78 assertEq('undefined', typeof(window.find('needle'))); |
79 assertEq('undefined', typeof(find('needle'))); | 79 assertEq('undefined', typeof(find('needle'))); |
80 succeed(); | 80 succeed(); |
81 }, | 81 }, |
82 | 82 |
83 function testWindowAlert() { | 83 function testWindowAlert() { |
84 assertEq('undefined', typeof(Window.prototype.alert())); | 84 assertEq('undefined', typeof(Window.prototype.alert)); |
85 assertEq('undefined', typeof(window.alert())); | 85 assertEq('undefined', typeof(window.alert())); |
86 assertEq('undefined', typeof(alert())); | 86 assertEq('undefined', typeof(alert())); |
87 succeed(); | 87 succeed(); |
88 }, | 88 }, |
89 | 89 |
90 function testWindowConfirm() { | 90 function testWindowConfirm() { |
91 assertEq('undefined', typeof(Window.prototype.confirm('Failed'))); | 91 assertEq('undefined', typeof(Window.prototype.confirm)); |
92 assertEq('undefined', typeof(window.confirm('Failed'))); | 92 assertEq('undefined', typeof(window.confirm('Failed'))); |
93 assertEq('undefined', typeof(confirm('Failed'))); | 93 assertEq('undefined', typeof(confirm('Failed'))); |
94 succeed(); | 94 succeed(); |
95 }, | 95 }, |
96 | 96 |
97 function testWindowPrompt() { | 97 function testWindowPrompt() { |
98 assertEq('undefined', typeof(Window.prototype.prompt('Failed'))); | 98 assertEq('undefined', typeof(Window.prototype.prompt)); |
99 assertEq('undefined', typeof(window.prompt('Failed'))); | 99 assertEq('undefined', typeof(window.prompt('Failed'))); |
100 assertEq('undefined', typeof(prompt('Failed'))); | 100 assertEq('undefined', typeof(prompt('Failed'))); |
101 succeed(); | 101 succeed(); |
102 }, | 102 }, |
103 | 103 |
104 function testBars() { | 104 function testBars() { |
105 var bars = ['locationbar', 'menubar', 'personalbar', | 105 var bars = ['locationbar', 'menubar', 'personalbar', |
106 'scrollbars', 'statusbar', 'toolbar']; | 106 'scrollbars', 'statusbar', 'toolbar']; |
107 for (var x = 0; x < bars.length; x++) { | 107 for (var x = 0; x < bars.length; x++) { |
108 assertEq('undefined', typeof(this[bars[x]])); | 108 assertEq('undefined', typeof(this[bars[x]])); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 assertEq('undefined', typeof(chrome.extension)); | 183 assertEq('undefined', typeof(chrome.extension)); |
184 succeed(); | 184 succeed(); |
185 }, | 185 }, |
186 | 186 |
187 function testExtensionApis() { | 187 function testExtensionApis() { |
188 assertEq('undefined', typeof(chrome.tabs)); | 188 assertEq('undefined', typeof(chrome.tabs)); |
189 assertEq('undefined', typeof(chrome.windows)); | 189 assertEq('undefined', typeof(chrome.windows)); |
190 succeed(); | 190 succeed(); |
191 } | 191 } |
192 ]); | 192 ]); |
OLD | NEW |