| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 onload = function() { | 5 onload = function() { |
| 6 var URL_A = | 6 var URL_A = |
| 7 "http://www.a.com:PORT/extensions/api_test/webnavigation/crash/a.html"; | 7 "http://www.a.com:PORT/extensions/api_test/webnavigation/crash/a.html"; |
| 8 var URL_B = | 8 var URL_B = |
| 9 "http://www.a.com:PORT/extensions/api_test/webnavigation/crash/b.html"; | 9 "http://www.a.com:PORT/extensions/api_test/webnavigation/crash/b.html"; |
| 10 chrome.tabs.create({"url": "about:blank"}, function(tab) { | 10 chrome.tabs.create({"url": "about:blank"}, function(tab) { |
| 11 var tabId = tab.id; | 11 var tabId = tab.id; |
| 12 chrome.test.getConfig(function(config) { | 12 chrome.test.getConfig(function(config) { |
| 13 var fixPort = function(url) { | 13 var fixPort = function(url) { |
| 14 return url.replace(/PORT/g, config.testServer.port); | 14 return url.replace(/PORT/g, config.testServer.port); |
| 15 }; | 15 }; |
| 16 URL_A = fixPort(URL_A); | 16 URL_A = fixPort(URL_A); |
| 17 URL_B = fixPort(URL_B); | 17 URL_B = fixPort(URL_B); |
| 18 | 18 |
| 19 chrome.test.runTests([ | 19 chrome.test.runTests([ |
| 20 // Navigates to an URL, then the renderer crashes, the navigates to | 20 // Navigates to an URL, then the renderer crashes, the navigates to |
| 21 // another URL. | 21 // another URL. |
| 22 function crash() { | 22 function crash() { |
| 23 expect([ | 23 expect([ |
| 24 { label: "a-onBeforeNavigate", | 24 { label: "a-onBeforeNavigate", |
| 25 event: "onBeforeNavigate", | 25 event: "onBeforeNavigate", |
| 26 details: { frameId: 0, | 26 details: { frameId: 0, |
| 27 parentFrameId: -1, | 27 parentFrameId: -1, |
| 28 processId: 0, | 28 processId: -1, |
| 29 tabId: 0, | 29 tabId: 0, |
| 30 timeStamp: 0, | 30 timeStamp: 0, |
| 31 url: URL_A }}, | 31 url: URL_A }}, |
| 32 { label: "a-onCommitted", | 32 { label: "a-onCommitted", |
| 33 event: "onCommitted", | 33 event: "onCommitted", |
| 34 details: { frameId: 0, | 34 details: { frameId: 0, |
| 35 processId: 0, | 35 processId: 0, |
| 36 tabId: 0, | 36 tabId: 0, |
| 37 timeStamp: 0, | 37 timeStamp: 0, |
| 38 transitionQualifiers: [], | 38 transitionQualifiers: [], |
| (...skipping 10 matching lines...) Expand all Loading... |
| 49 event: "onCompleted", | 49 event: "onCompleted", |
| 50 details: { frameId: 0, | 50 details: { frameId: 0, |
| 51 processId: 0, | 51 processId: 0, |
| 52 tabId: 0, | 52 tabId: 0, |
| 53 timeStamp: 0, | 53 timeStamp: 0, |
| 54 url: URL_A }}, | 54 url: URL_A }}, |
| 55 { label: "b-onBeforeNavigate", | 55 { label: "b-onBeforeNavigate", |
| 56 event: "onBeforeNavigate", | 56 event: "onBeforeNavigate", |
| 57 details: { frameId: 0, | 57 details: { frameId: 0, |
| 58 parentFrameId: -1, | 58 parentFrameId: -1, |
| 59 processId: 0, | 59 processId: -1, |
| 60 tabId: 0, | 60 tabId: 0, |
| 61 timeStamp: 0, | 61 timeStamp: 0, |
| 62 url: URL_B }}, | 62 url: URL_B }}, |
| 63 { label: "b-onCommitted", | 63 { label: "b-onCommitted", |
| 64 event: "onCommitted", | 64 event: "onCommitted", |
| 65 details: { frameId: 0, | 65 details: { frameId: 0, |
| 66 processId: 0, | 66 processId: 0, |
| 67 tabId: 0, | 67 tabId: 0, |
| 68 timeStamp: 0, | 68 timeStamp: 0, |
| 69 transitionQualifiers: [], | 69 transitionQualifiers: [], |
| (...skipping 15 matching lines...) Expand all Loading... |
| 85 url: URL_B }}], | 85 url: URL_B }}], |
| 86 [ navigationOrder("a-"), navigationOrder("b-") ]); | 86 [ navigationOrder("a-"), navigationOrder("b-") ]); |
| 87 | 87 |
| 88 // Notify the api test that we're waiting for the user. | 88 // Notify the api test that we're waiting for the user. |
| 89 chrome.test.notifyPass(); | 89 chrome.test.notifyPass(); |
| 90 }, | 90 }, |
| 91 ]); | 91 ]); |
| 92 }); | 92 }); |
| 93 }); | 93 }); |
| 94 }; | 94 }; |
| OLD | NEW |