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 deepEq = chrome.test.checkDeepEq; | 5 var deepEq = chrome.test.checkDeepEq; |
6 var expectedEventData; | 6 var expectedEventData; |
7 var expectedEventOrder; | 7 var expectedEventOrder; |
8 var capturedEventData; | 8 var capturedEventData; |
9 var nextFrameId; | 9 var nextFrameId; |
10 var frameIds; | 10 var frameIds; |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 captureEvent("onReferenceFragmentUpdated", details); | 160 captureEvent("onReferenceFragmentUpdated", details); |
161 }); | 161 }); |
162 chrome.webNavigation.onErrorOccurred.addListener( | 162 chrome.webNavigation.onErrorOccurred.addListener( |
163 function(details) { | 163 function(details) { |
164 captureEvent("onErrorOccurred", details); | 164 captureEvent("onErrorOccurred", details); |
165 }); | 165 }); |
166 chrome.webNavigation.onTabReplaced.addListener( | 166 chrome.webNavigation.onTabReplaced.addListener( |
167 function(details) { | 167 function(details) { |
168 captureEvent("onTabReplaced", details); | 168 captureEvent("onTabReplaced", details); |
169 }); | 169 }); |
| 170 chrome.webNavigation.onHistoryStateUpdated.addListener( |
| 171 function(details) { |
| 172 captureEvent("onHistoryStateUpdated", details); |
| 173 }); |
170 } | 174 } |
171 | 175 |
172 // Returns the usual order of navigation events. | 176 // Returns the usual order of navigation events. |
173 function navigationOrder(prefix) { | 177 function navigationOrder(prefix) { |
174 return [ prefix + "onBeforeNavigate", | 178 return [ prefix + "onBeforeNavigate", |
175 prefix + "onCommitted", | 179 prefix + "onCommitted", |
176 prefix + "onDOMContentLoaded", | 180 prefix + "onDOMContentLoaded", |
177 prefix + "onCompleted" ]; | 181 prefix + "onCompleted" ]; |
178 } | 182 } |
179 | 183 |
180 // Returns the constraints expressing that a frame is an iframe of another | 184 // Returns the constraints expressing that a frame is an iframe of another |
181 // frame. | 185 // frame. |
182 function isIFrameOf(iframe, main_frame) { | 186 function isIFrameOf(iframe, main_frame) { |
183 return [ main_frame + "onCommitted", | 187 return [ main_frame + "onCommitted", |
184 iframe + "onBeforeNavigate", | 188 iframe + "onBeforeNavigate", |
185 main_frame + "onDOMContentLoaded", | 189 main_frame + "onDOMContentLoaded", |
186 iframe + "onCompleted", | 190 iframe + "onCompleted", |
187 main_frame + "onCompleted" ]; | 191 main_frame + "onCompleted" ]; |
188 } | 192 } |
189 | 193 |
190 // Returns the constraint expressing that a frame was loaded by another. | 194 // Returns the constraint expressing that a frame was loaded by another. |
191 function isLoadedBy(target, source) { | 195 function isLoadedBy(target, source) { |
192 return [ source + "onDOMContentLoaded", target + "onBeforeNavigate"]; | 196 return [ source + "onDOMContentLoaded", target + "onBeforeNavigate"]; |
193 } | 197 } |
OLD | NEW |