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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 succeed(); | 61 succeed(); |
62 }, | 62 }, |
63 | 63 |
64 function testHistory() { | 64 function testHistory() { |
65 // Accessing these logs warnings to the console. | 65 // Accessing these logs warnings to the console. |
66 assertEq('undefined', typeof(history.back)); | 66 assertEq('undefined', typeof(history.back)); |
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 | 70 assertEq('undefined', typeof(history.pushState)); |
71 // These are part of the HTML5 History API that are feature detected, so we | 71 assertEq('undefined', typeof(history.replaceState)); |
72 // remove them altogether, allowing apps to have fallback behavior. | 72 assertEq('undefined', typeof(history.state)); |
73 chrome.test.assertFalse('pushState' in history); | |
74 chrome.test.assertFalse('replaceState' in history); | |
75 chrome.test.assertFalse('state' in history); | |
76 | |
77 succeed(); | 73 succeed(); |
78 }, | 74 }, |
79 | 75 |
80 function testWindowFind() { | 76 function testWindowFind() { |
81 assertEq('undefined', typeof(Window.prototype.find('needle'))); | 77 assertEq('undefined', typeof(Window.prototype.find('needle'))); |
82 assertEq('undefined', typeof(window.find('needle'))); | 78 assertEq('undefined', typeof(window.find('needle'))); |
83 assertEq('undefined', typeof(find('needle'))); | 79 assertEq('undefined', typeof(find('needle'))); |
84 succeed(); | 80 succeed(); |
85 }, | 81 }, |
86 | 82 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 assertEq('undefined', typeof(chrome.extension)); | 184 assertEq('undefined', typeof(chrome.extension)); |
189 succeed(); | 185 succeed(); |
190 }, | 186 }, |
191 | 187 |
192 function testExtensionApis() { | 188 function testExtensionApis() { |
193 assertEq('undefined', typeof(chrome.tabs)); | 189 assertEq('undefined', typeof(chrome.tabs)); |
194 assertEq('undefined', typeof(chrome.windows)); | 190 assertEq('undefined', typeof(chrome.windows)); |
195 succeed(); | 191 succeed(); |
196 } | 192 } |
197 ]); | 193 ]); |
OLD | NEW |