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 secondWindowId; | 5 var secondWindowId; |
6 var thirdWindowId; | 6 var thirdWindowId; |
7 var testTabId; | 7 var testTabId; |
8 | 8 |
9 function clickLink(id) { | 9 function clickLink(id) { |
10 var clickEvent = document.createEvent('MouseEvents'); | 10 var clickEvent = document.createEvent('MouseEvents'); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 })); | 84 })); |
85 })); | 85 })); |
86 }, | 86 }, |
87 | 87 |
88 function update() { | 88 function update() { |
89 chrome.tabs.get(testTabId, pass(function(tab) { | 89 chrome.tabs.get(testTabId, pass(function(tab) { |
90 assertEq(pageUrl("a"), tab.url); | 90 assertEq(pageUrl("a"), tab.url); |
91 // Update url. | 91 // Update url. |
92 chrome.tabs.update(testTabId, {"url": pageUrl("c")}, | 92 chrome.tabs.update(testTabId, {"url": pageUrl("c")}, |
93 pass(function(tab){ | 93 pass(function(tab){ |
94 chrome.test.assertEq(pageUrl("c"), tab.url); | 94 // TODO(creis): The tab's visible URL won't change until the navigation |
| 95 // commits. There doesn't seem to be a way to check what the pending |
| 96 // URL is here, so this test should wait until the navigation commits. |
| 97 // chrome.test.assertEq(pageUrl("c"), tab.url); |
95 // Check url. | 98 // Check url. |
96 chrome.tabs.get(testTabId, pass(function(tab) { | 99 //chrome.tabs.get(testTabId, pass(function(tab) { |
97 assertEq(pageUrl("c"), tab.url); | 100 // assertEq(pageUrl("c"), tab.url); |
98 })); | 101 //})); |
99 })); | 102 })); |
100 })); | 103 })); |
101 }, | 104 }, |
102 | 105 |
103 function openerTabId() { | 106 function openerTabId() { |
104 chrome.test.listenOnce( | 107 chrome.test.listenOnce( |
105 chrome.tabs.onCreated, | 108 chrome.tabs.onCreated, |
106 function(tab) { | 109 function(tab) { |
107 chrome.tabs.getCurrent(pass(function(thisTab) { | 110 chrome.tabs.getCurrent(pass(function(thisTab) { |
108 assertEq(thisTab.id, tab.openerTabId); | 111 assertEq(thisTab.id, tab.openerTabId); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 assertEq(window.tabs.length, 1); | 175 assertEq(window.tabs.length, 1); |
173 chrome.tabs.get(tab.id, pass(function(updatedTabInfo) { | 176 chrome.tabs.get(tab.id, pass(function(updatedTabInfo) { |
174 assertEq(tab.windowId, updatedTabInfo.windowId); | 177 assertEq(tab.windowId, updatedTabInfo.windowId); |
175 assertTrue(window.id != updatedTabInfo.windowId); | 178 assertTrue(window.id != updatedTabInfo.windowId); |
176 })); | 179 })); |
177 })); | 180 })); |
178 })); | 181 })); |
179 }, | 182 }, |
180 | 183 |
181 ]); | 184 ]); |
OLD | NEW |