OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 expectedEventData; | 5 var expectedEventData; |
6 var capturedEventData; | 6 var capturedEventData; |
7 var shouldIgnore; | 7 var shouldIgnore; |
8 | 8 |
9 function expect(data, ignoreFunc) { | 9 function expect(data, ignoreFunc) { |
10 expectedEventData = data; | 10 expectedEventData = data; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 }, | 112 }, |
113 | 113 |
114 function faviconLoaded() { | 114 function faviconLoaded() { |
115 expect([ | 115 expect([ |
116 { status: 'loading', url: getURL('favicon/a.html') }, | 116 { status: 'loading', url: getURL('favicon/a.html') }, |
117 { status: 'complete' }, | 117 { status: 'complete' }, |
118 { favIconUrl: getURL('favicon/favicon.ico') }, | 118 { favIconUrl: getURL('favicon/favicon.ico') }, |
119 ]); | 119 ]); |
120 | 120 |
121 chrome.tabs.create({ url: getURL('favicon/a.html') }); | 121 chrome.tabs.create({ url: getURL('favicon/a.html') }); |
| 122 }, |
| 123 |
| 124 function historyReplaceState() { |
| 125 // No more events. Because replaceState doesn't change url. |
| 126 expect([ |
| 127 { status: 'loading', url: getURL('historyReplaceState/a.html') }, |
| 128 { status: 'complete' } |
| 129 ]); |
| 130 |
| 131 chrome.tabs.create({ url: getURL('historyReplaceState/a.html') }); |
| 132 }, |
| 133 |
| 134 function historyReplaceStateUpdateUrl() { |
| 135 // url status is updated. Because history.replaceState updates url. |
| 136 expect([ |
| 137 { status: 'loading', url: getURL('historyReplaceStateUpdateUrl/a.html') }, |
| 138 { status: 'complete' }, |
| 139 { url: getURL('historyReplaceStateUpdateUrl/a.html#a') }, |
| 140 ]); |
| 141 |
| 142 chrome.tabs.create({ url: getURL('historyReplaceStateUpdateUrl/a.html') }); |
| 143 }, |
| 144 |
| 145 function historyPushState() { |
| 146 // - a.html starts loading and complete. |
| 147 // - historyPushState doesn't updates current url. |
| 148 expect([ |
| 149 { status: 'loading', url: getURL('historyPushState/a.html') }, |
| 150 { status: 'complete' }, |
| 151 { status: 'loading' }, |
| 152 { status: 'complete' }, |
| 153 ]); |
| 154 |
| 155 chrome.tabs.create({ url: getURL('historyPushState/a.html') }); |
| 156 }, |
| 157 |
| 158 function historyPushStateUpdateUrl() { |
| 159 // - a.html starts loading and complete. |
| 160 // - historyPushState updates current url. so that 'loading' and 'complete' |
| 161 // are fired with updated url. |
| 162 expect([ |
| 163 { status: 'loading', url: getURL('historyPushStateUpdateUrl/a.html') }, |
| 164 { status: 'complete' }, |
| 165 { status: 'loading', url: getURL('historyPushStateUpdateUrl/a.html#a') }, |
| 166 { status: 'complete' }, |
| 167 ]); |
| 168 |
| 169 chrome.tabs.create({ url: getURL('historyPushStateUpdateUrl/a.html') }); |
122 } | 170 } |
123 ]); | 171 ]); |
OLD | NEW |