| OLD | NEW |
| 1 // tabs api test | 1 // tabs api test |
| 2 // browser_tests.exe --gtest_filter=ExtensionApiTest.Tabs | 2 // browser_tests.exe --gtest_filter=ExtensionApiTest.Tabs |
| 3 | 3 |
| 4 // We have a bunch of places where we need to remember some state from one | 4 // We have a bunch of places where we need to remember some state from one |
| 5 // test (or setup code) to subsequent tests. | 5 // test (or setup code) to subsequent tests. |
| 6 var firstWindowId = null; | 6 var firstWindowId = null; |
| 7 var secondWindowId = null; | 7 var secondWindowId = null; |
| 8 var firstTabIndex = null; | 8 var firstTabIndex = null; |
| 9 var testTabId = null; | 9 var testTabId = null; |
| 10 | 10 |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 assertTrue(!window.incognito); | 433 assertTrue(!window.incognito); |
| 434 windowEventsWindow = window; | 434 windowEventsWindow = window; |
| 435 chrome.tabs.getAllInWindow(window.id, pass(function(tabs) { | 435 chrome.tabs.getAllInWindow(window.id, pass(function(tabs) { |
| 436 assertEq(pageUrl("a"), tabs[0].url); | 436 assertEq(pageUrl("a"), tabs[0].url); |
| 437 })); | 437 })); |
| 438 }); | 438 }); |
| 439 | 439 |
| 440 chrome.windows.create({"url": pageUrl("a")}, pass(function(tab) {})); | 440 chrome.windows.create({"url": pageUrl("a")}, pass(function(tab) {})); |
| 441 }, | 441 }, |
| 442 | 442 |
| 443 function windowSetFocused() { |
| 444 chrome.windows.getCurrent(function(oldWin) { |
| 445 chrome.windows.create({}, function(newWin) { |
| 446 assertTrue(newWin.focused); |
| 447 chrome.windows.update(oldWin.id, {focused:true}); |
| 448 chrome.windows.get(oldWin.id, pass(function(oldWin2) { |
| 449 assertTrue(oldWin2.focused); |
| 450 })); |
| 451 }); |
| 452 }); |
| 453 }, |
| 454 |
| 443 /* TODO: Enable this test when crbug.com/28055 is fixed. This bug causes a | 455 /* TODO: Enable this test when crbug.com/28055 is fixed. This bug causes a |
| 444 newly created window not to be set as the current window, if | 456 newly created window not to be set as the current window, if |
| 445 Chrome was not the foreground window when the create call was made. | 457 Chrome was not the foreground window when the create call was made. |
| 446 function windowsOnFocusChanged() { | 458 function windowsOnFocusChanged() { |
| 447 chrome.windows.create({}, pass(function(window) { | 459 chrome.windows.create({}, pass(function(window) { |
| 448 chrome.test.listenOnce(chrome.windows.onFocusChanged, | 460 chrome.test.listenOnce(chrome.windows.onFocusChanged, |
| 449 function(windowId) { | 461 function(windowId) { |
| 450 assertEq(windowEventsWindow.id, windowId); | 462 assertEq(windowEventsWindow.id, windowId); |
| 451 }); | 463 }); |
| 452 chrome.windows.remove(window.id); | 464 chrome.windows.remove(window.id); |
| 453 })); | 465 })); |
| 454 } */ | 466 } */ |
| 455 ]); | 467 ]); |
| OLD | NEW |