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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
55 assertEq('undefined', typeof(document.bgColor)); | 55 assertEq('undefined', typeof(document.bgColor)); |
56 assertEq('undefined', typeof(document.fgColor)); | 56 assertEq('undefined', typeof(document.fgColor)); |
57 assertEq('undefined', typeof(document.alinkColor)); | 57 assertEq('undefined', typeof(document.alinkColor)); |
58 assertEq('undefined', typeof(document.linkColor)); | 58 assertEq('undefined', typeof(document.linkColor)); |
59 assertEq('undefined', typeof(document.vlinkColor)); | 59 assertEq('undefined', typeof(document.vlinkColor)); |
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 // History API should be disabled (e.g. Accessing these logs warnings to |
66 assertEq('undefined', typeof(history.back)); | 66 // the console). |
67 assertEq('undefined', typeof(history.forward)); | 67 for (var property in history) { |
68 assertEq('undefined', typeof(history.length)); | 68 assertEq('undefined', typeof(history[property])); |
Inactive
2014/04/21 19:46:10
This is a bit safer now, in case new properties /
| |
69 } | |
69 | 70 |
70 // These are part of the HTML5 History API that are feature detected, so we | 71 // These are part of the HTML5 History API that are feature detected, so we |
71 // remove them altogether, allowing apps to have fallback behavior. | 72 // remove them altogether, allowing apps to have fallback behavior. |
72 chrome.test.assertFalse('pushState' in history); | 73 chrome.test.assertFalse('pushState' in history); |
73 chrome.test.assertFalse('replaceState' in history); | 74 chrome.test.assertFalse('replaceState' in history); |
74 chrome.test.assertFalse('state' in history); | 75 chrome.test.assertFalse('state' in history); |
75 | 76 |
76 succeed(); | 77 succeed(); |
77 }, | 78 }, |
78 | 79 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
187 assertEq('undefined', typeof(chrome.extension)); | 188 assertEq('undefined', typeof(chrome.extension)); |
188 succeed(); | 189 succeed(); |
189 }, | 190 }, |
190 | 191 |
191 function testExtensionApis() { | 192 function testExtensionApis() { |
192 assertEq('undefined', typeof(chrome.tabs)); | 193 assertEq('undefined', typeof(chrome.tabs)); |
193 assertEq('undefined', typeof(chrome.windows)); | 194 assertEq('undefined', typeof(chrome.windows)); |
194 succeed(); | 195 succeed(); |
195 } | 196 } |
196 ]); | 197 ]); |
OLD | NEW |