| 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([ |
| 11 // Navigates to an URL. | 11 // Navigates to an URL. |
| 12 function simpleLoad() { | 12 function simpleLoad() { |
| 13 expect([ | 13 expect([ |
| 14 [ "onBeforeNavigate", | 14 { label: "a-onBeforeNavigate", |
| 15 { frameId: 0, | 15 event: "onBeforeNavigate", |
| 16 tabId: 0, | 16 details: { frameId: 0, |
| 17 timeStamp: 0, | 17 tabId: 0, |
| 18 url: getURL('simpleLoad/a.html') }], | 18 timeStamp: 0, |
| 19 [ "onCommitted", | 19 url: getURL('simpleLoad/a.html') }}, |
| 20 { frameId: 0, | 20 { label: "a-onCommitted", |
| 21 tabId: 0, | 21 event: "onCommitted", |
| 22 timeStamp: 0, | 22 details: { frameId: 0, |
| 23 transitionQualifiers: [], | 23 tabId: 0, |
| 24 transitionType: "link", | 24 timeStamp: 0, |
| 25 url: getURL('simpleLoad/a.html') }], | 25 transitionQualifiers: [], |
| 26 [ "onDOMContentLoaded", | 26 transitionType: "link", |
| 27 { frameId: 0, | 27 url: getURL('simpleLoad/a.html') }}, |
| 28 tabId: 0, | 28 { label: "a-onDOMContentLoaded", |
| 29 timeStamp: 0, | 29 event: "onDOMContentLoaded", |
| 30 url: getURL('simpleLoad/a.html') }], | 30 details: { frameId: 0, |
| 31 [ "onCompleted", | 31 tabId: 0, |
| 32 { frameId: 0, | 32 timeStamp: 0, |
| 33 tabId: 0, | 33 url: getURL('simpleLoad/a.html') }}, |
| 34 timeStamp: 0, | 34 { label: "a-onCompleted", |
| 35 url: getURL('simpleLoad/a.html') }]]); | 35 event: "onCompleted", |
| 36 details: { frameId: 0, |
| 37 tabId: 0, |
| 38 timeStamp: 0, |
| 39 url: getURL('simpleLoad/a.html') }}], |
| 40 [ navigationOrder("a-") ]); |
| 36 chrome.tabs.update(tabId, { url: getURL('simpleLoad/a.html') }); | 41 chrome.tabs.update(tabId, { url: getURL('simpleLoad/a.html') }); |
| 37 }, | 42 }, |
| 38 ]); | 43 ]); |
| 39 }); | 44 }); |
| 40 } | 45 } |
| OLD | NEW |