Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: chrome/test/data/extensions/api_test/tabs/basics/test.js

Issue 3584010: Add chrome.windows.update({focused:true}); (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/common/extensions/api/extension_api.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 ]);
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/extension_api.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698