| 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 function runTests() { | 5 function runTests() { |
| 6 var getURL = chrome.extension.getURL; | 6 var getURL = chrome.extension.getURL; |
| 7 chrome.tabs.create({"url": "about:blank"}, function(tab) { | 7 chrome.tabs.create({"url": "about:blank"}, function(tab) { |
| 8 var tabId = tab.id; | 8 var tabId = tab.id; |
| 9 | 9 |
| 10 chrome.test.runTests([ | 10 chrome.test.runTests([ |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 tabId: 0, | 144 tabId: 0, |
| 145 timeStamp: 0, | 145 timeStamp: 0, |
| 146 url: getURL('failures/c.html') }}], | 146 url: getURL('failures/c.html') }}], |
| 147 [ navigationOrder("a-"), | 147 [ navigationOrder("a-"), |
| 148 navigationOrder("b-"), | 148 navigationOrder("b-"), |
| 149 isIFrameOf("b-", "a-"), | 149 isIFrameOf("b-", "a-"), |
| 150 isLoadedBy("c-", "b-"), | 150 isLoadedBy("c-", "b-"), |
| 151 ["c-onBeforeNavigate", "c-onErrorOccurred"]]); | 151 ["c-onBeforeNavigate", "c-onErrorOccurred"]]); |
| 152 chrome.tabs.update(tabId, { url: getURL('failures/a.html') }); | 152 chrome.tabs.update(tabId, { url: getURL('failures/a.html') }); |
| 153 }, | 153 }, |
| 154 |
| 155 // Cancel a navigation after it is already committed. |
| 156 function cancel() { |
| 157 expect([ |
| 158 { label: "onBeforeNavigate", |
| 159 event: "onBeforeNavigate", |
| 160 details: { frameId: 0, |
| 161 tabId: 0, |
| 162 timeStamp: 0, |
| 163 url: getURL('failures/e.html') }}, |
| 164 { label: "onCommitted", |
| 165 event: "onCommitted", |
| 166 details: { frameId: 0, |
| 167 tabId: 0, |
| 168 timeStamp: 0, |
| 169 transitionQualifiers: [], |
| 170 transitionType: "link", |
| 171 url: getURL('failures/e.html') }}, |
| 172 { label: "onDOMContentLoaded", |
| 173 event: "onDOMContentLoaded", |
| 174 details: { frameId: 0, |
| 175 tabId: 0, |
| 176 timeStamp: 0, |
| 177 url: getURL('failures/e.html') }}, |
| 178 { label: "onErrorOccurred", |
| 179 event: "onErrorOccurred", |
| 180 details: { error: "net::ERR_ABORTED", |
| 181 frameId: 0, |
| 182 tabId: 0, |
| 183 timeStamp: 0, |
| 184 url: getURL('failures/e.html') }}], |
| 185 [["onBeforeNavigate", "onCommitted", "onDOMContentLoaded", |
| 186 "onErrorOccurred"]]); |
| 187 chrome.tabs.update(tabId, { url: getURL('failures/e.html') }); |
| 188 }, |
| 154 ]); | 189 ]); |
| 155 }); | 190 }); |
| 156 } | 191 } |
| OLD | NEW |