| 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 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 // Opens a new tab from javascript. | 11 // Opens a new tab from javascript. |
| 12 function openTab() { | 12 function openTab() { |
| 13 expect([ | 13 expect([ |
| 14 { label: "a-onBeforeNavigate", | 14 { label: "a-onBeforeNavigate", |
| 15 event: "onBeforeNavigate", | 15 event: "onBeforeNavigate", |
| 16 details: { frameId: 0, | 16 details: { frameId: 0, |
| 17 parentFrameId: -1, | 17 parentFrameId: -1, |
| 18 processId: 0, | 18 processId: -1, |
| 19 tabId: 0, | 19 tabId: 0, |
| 20 timeStamp: 0, | 20 timeStamp: 0, |
| 21 url: getURL('a.html') }}, | 21 url: getURL('a.html') }}, |
| 22 { label: "a-onCommitted", | 22 { label: "a-onCommitted", |
| 23 event: "onCommitted", | 23 event: "onCommitted", |
| 24 details: { frameId: 0, | 24 details: { frameId: 0, |
| 25 processId: 0, | 25 processId: 0, |
| 26 tabId: 0, | 26 tabId: 0, |
| 27 timeStamp: 0, | 27 timeStamp: 0, |
| 28 transitionQualifiers: [], | 28 transitionQualifiers: [], |
| (...skipping 18 matching lines...) Expand all Loading... |
| 47 details: { sourceFrameId: 0, | 47 details: { sourceFrameId: 0, |
| 48 sourceProcessId: 0, | 48 sourceProcessId: 0, |
| 49 sourceTabId: 0, | 49 sourceTabId: 0, |
| 50 tabId: 1, | 50 tabId: 1, |
| 51 timeStamp: 0, | 51 timeStamp: 0, |
| 52 url: getURL('b.html') }}, | 52 url: getURL('b.html') }}, |
| 53 { label: "b-onBeforeNavigate", | 53 { label: "b-onBeforeNavigate", |
| 54 event: "onBeforeNavigate", | 54 event: "onBeforeNavigate", |
| 55 details: { frameId: 0, | 55 details: { frameId: 0, |
| 56 parentFrameId: -1, | 56 parentFrameId: -1, |
| 57 processId: 0, | 57 processId: -1, |
| 58 tabId: 1, | 58 tabId: 1, |
| 59 timeStamp: 0, | 59 timeStamp: 0, |
| 60 url: getURL('b.html') }}, | 60 url: getURL('b.html') }}, |
| 61 { label: "b-onCommitted", | 61 { label: "b-onCommitted", |
| 62 event: "onCommitted", | 62 event: "onCommitted", |
| 63 details: { frameId: 0, | 63 details: { frameId: 0, |
| 64 processId: 0, | 64 processId: 0, |
| 65 tabId: 1, | 65 tabId: 1, |
| 66 timeStamp: 0, | 66 timeStamp: 0, |
| 67 transitionQualifiers: [], | 67 transitionQualifiers: [], |
| (...skipping 20 matching lines...) Expand all Loading... |
| 88 chrome.tabs.update(tabId, { url: getURL('a.html') }); | 88 chrome.tabs.update(tabId, { url: getURL('a.html') }); |
| 89 }, | 89 }, |
| 90 | 90 |
| 91 // Opens a new tab from javascript within an iframe. | 91 // Opens a new tab from javascript within an iframe. |
| 92 function openTabFrame() { | 92 function openTabFrame() { |
| 93 expect([ | 93 expect([ |
| 94 { label: "c-onBeforeNavigate", | 94 { label: "c-onBeforeNavigate", |
| 95 event: "onBeforeNavigate", | 95 event: "onBeforeNavigate", |
| 96 details: { frameId: 0, | 96 details: { frameId: 0, |
| 97 parentFrameId: -1, | 97 parentFrameId: -1, |
| 98 processId: 0, | 98 processId: -1, |
| 99 tabId: 0, | 99 tabId: 0, |
| 100 timeStamp: 0, | 100 timeStamp: 0, |
| 101 url: getURL('c.html') }}, | 101 url: getURL('c.html') }}, |
| 102 { label: "c-onCommitted", | 102 { label: "c-onCommitted", |
| 103 event: "onCommitted", | 103 event: "onCommitted", |
| 104 details: { frameId: 0, | 104 details: { frameId: 0, |
| 105 processId: 0, | 105 processId: 0, |
| 106 tabId: 0, | 106 tabId: 0, |
| 107 timeStamp: 0, | 107 timeStamp: 0, |
| 108 transitionQualifiers: [], | 108 transitionQualifiers: [], |
| (...skipping 10 matching lines...) Expand all Loading... |
| 119 event: "onCompleted", | 119 event: "onCompleted", |
| 120 details: { frameId: 0, | 120 details: { frameId: 0, |
| 121 processId: 0, | 121 processId: 0, |
| 122 tabId: 0, | 122 tabId: 0, |
| 123 timeStamp: 0, | 123 timeStamp: 0, |
| 124 url: getURL('c.html') }}, | 124 url: getURL('c.html') }}, |
| 125 { label: "a-onBeforeNavigate", | 125 { label: "a-onBeforeNavigate", |
| 126 event: "onBeforeNavigate", | 126 event: "onBeforeNavigate", |
| 127 details: { frameId: 1, | 127 details: { frameId: 1, |
| 128 parentFrameId: 0, | 128 parentFrameId: 0, |
| 129 processId: 0, | 129 processId: -1, |
| 130 tabId: 0, | 130 tabId: 0, |
| 131 timeStamp: 0, | 131 timeStamp: 0, |
| 132 url: getURL('a.html') }}, | 132 url: getURL('a.html') }}, |
| 133 { label: "a-onCommitted", | 133 { label: "a-onCommitted", |
| 134 event: "onCommitted", | 134 event: "onCommitted", |
| 135 details: { frameId: 1, | 135 details: { frameId: 1, |
| 136 processId: 0, | 136 processId: 0, |
| 137 tabId: 0, | 137 tabId: 0, |
| 138 timeStamp: 0, | 138 timeStamp: 0, |
| 139 transitionQualifiers: [], | 139 transitionQualifiers: [], |
| (...skipping 18 matching lines...) Expand all Loading... |
| 158 details: { sourceFrameId: 1, | 158 details: { sourceFrameId: 1, |
| 159 sourceProcessId: 0, | 159 sourceProcessId: 0, |
| 160 sourceTabId: 0, | 160 sourceTabId: 0, |
| 161 tabId: 1, | 161 tabId: 1, |
| 162 timeStamp: 0, | 162 timeStamp: 0, |
| 163 url: getURL('b.html') }}, | 163 url: getURL('b.html') }}, |
| 164 { label: "b-onBeforeNavigate", | 164 { label: "b-onBeforeNavigate", |
| 165 event: "onBeforeNavigate", | 165 event: "onBeforeNavigate", |
| 166 details: { frameId: 0, | 166 details: { frameId: 0, |
| 167 parentFrameId: -1, | 167 parentFrameId: -1, |
| 168 processId: 0, | 168 processId: -1, |
| 169 tabId: 1, | 169 tabId: 1, |
| 170 timeStamp: 0, | 170 timeStamp: 0, |
| 171 url: getURL('b.html') }}, | 171 url: getURL('b.html') }}, |
| 172 { label: "b-onCommitted", | 172 { label: "b-onCommitted", |
| 173 event: "onCommitted", | 173 event: "onCommitted", |
| 174 details: { frameId: 0, | 174 details: { frameId: 0, |
| 175 processId: 0, | 175 processId: 0, |
| 176 tabId: 1, | 176 tabId: 1, |
| 177 timeStamp: 0, | 177 timeStamp: 0, |
| 178 transitionQualifiers: [], | 178 transitionQualifiers: [], |
| (...skipping 17 matching lines...) Expand all Loading... |
| 196 navigationOrder("b-"), | 196 navigationOrder("b-"), |
| 197 navigationOrder("c-"), | 197 navigationOrder("c-"), |
| 198 isIFrameOf("a-", "c-"), | 198 isIFrameOf("a-", "c-"), |
| 199 ["a-onDOMContentLoaded", "a-onCreatedNavigationTarget", | 199 ["a-onDOMContentLoaded", "a-onCreatedNavigationTarget", |
| 200 "b-onBeforeNavigate"]]); | 200 "b-onBeforeNavigate"]]); |
| 201 chrome.tabs.update(tabId, { url: getURL('c.html') }); | 201 chrome.tabs.update(tabId, { url: getURL('c.html') }); |
| 202 }, | 202 }, |
| 203 ]); | 203 ]); |
| 204 }); | 204 }); |
| 205 }; | 205 }; |
| OLD | NEW |