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 firstWindowId; | 5 var firstWindowId; |
6 | 6 |
7 chrome.test.runTests([ | 7 chrome.test.runTests([ |
8 function getSelected() { | 8 function getSelected() { |
9 chrome.tabs.getSelected(null, pass(function(tab) { | 9 chrome.tabs.getSelected(null, pass(function(tab) { |
10 assertEq(location.href, tab.url); | 10 assertEq(location.href, tab.url); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 function getCurrentWindow() { | 125 function getCurrentWindow() { |
126 var errorMsg = "No window with id: -1."; | 126 var errorMsg = "No window with id: -1."; |
127 chrome.windows.get(chrome.windows.WINDOW_ID_NONE, fail(errorMsg)); | 127 chrome.windows.get(chrome.windows.WINDOW_ID_NONE, fail(errorMsg)); |
128 chrome.windows.get(chrome.windows.WINDOW_ID_CURRENT, pass(function(win1) { | 128 chrome.windows.get(chrome.windows.WINDOW_ID_CURRENT, pass(function(win1) { |
129 chrome.windows.getCurrent(pass(function(win2) { | 129 chrome.windows.getCurrent(pass(function(win2) { |
130 assertEq(win1.id, win2.id); | 130 assertEq(win1.id, win2.id); |
131 })); | 131 })); |
132 })); | 132 })); |
133 } | 133 } |
134 | 134 |
135 /* Disabled -- see http://bugs.chromium.org/58229. | 135 /* Disabled -- see http://crbug.com/58229. |
136 function windowSetFocused() { | 136 function windowSetFocused() { |
137 chrome.windows.getCurrent(function(oldWin) { | 137 chrome.windows.getCurrent(function(oldWin) { |
138 chrome.windows.create({}, function(newWin) { | 138 chrome.windows.create({}, function(newWin) { |
139 assertTrue(newWin.focused); | 139 assertTrue(newWin.focused); |
140 chrome.windows.update(oldWin.id, {focused:true}); | 140 chrome.windows.update(oldWin.id, {focused:true}); |
141 chrome.windows.get(oldWin.id, pass(function(oldWin2) { | 141 chrome.windows.get(oldWin.id, pass(function(oldWin2) { |
142 assertTrue(oldWin2.focused); | 142 assertTrue(oldWin2.focused); |
143 })); | 143 })); |
144 }); | 144 }); |
145 }); | 145 }); |
146 }, | 146 }, |
147 */ | 147 */ |
148 ]); | 148 ]); |
OLD | NEW |