OLD | NEW |
1 <script src="tabs_util.js"></script> | 1 <script src="tabs_util.js"></script> |
2 | 2 |
3 <script> | 3 <script> |
4 var firstWindowId; | 4 var firstWindowId; |
5 | 5 |
6 chrome.test.runTests([ | 6 chrome.test.runTests([ |
7 function getSelected() { | 7 function getSelected() { |
8 chrome.tabs.getSelected(null, pass(function(tab) { | 8 chrome.tabs.getSelected(null, pass(function(tab) { |
9 assertEq(location.href, tab.url); | 9 assertEq(location.href, tab.url); |
10 assertEq(location.href, tab.title); | 10 assertEq(location.href, tab.title); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 })); | 85 })); |
86 }, | 86 }, |
87 | 87 |
88 function getAllInWindowNullArg() { | 88 function getAllInWindowNullArg() { |
89 chrome.tabs.getAllInWindow(null, pass(function(tabs) { | 89 chrome.tabs.getAllInWindow(null, pass(function(tabs) { |
90 assertEq(5, tabs.length); | 90 assertEq(5, tabs.length); |
91 assertEq(firstWindowId, tabs[0].windowId); | 91 assertEq(firstWindowId, tabs[0].windowId); |
92 })); | 92 })); |
93 }, | 93 }, |
94 | 94 |
95 /* Sadly, this has also regressed. crbug.com/60802. | |
96 function detectLanguage() { | 95 function detectLanguage() { |
97 chrome.tabs.getAllInWindow(firstWindowId, pass(function(tabs) { | 96 chrome.tabs.getAllInWindow(firstWindowId, pass(function(tabs) { |
98 chrome.tabs.detectLanguage(tabs[0].id, pass(function(lang) { | 97 chrome.tabs.detectLanguage(tabs[0].id, pass(function(lang) { |
99 assertEq("en", lang); | 98 assertEq("und", lang); |
100 })); | 99 })); |
101 })); | 100 })); |
102 }, | 101 }, |
103 */ | |
104 | 102 |
105 function windowCreate() { | 103 function windowCreate() { |
106 chrome.windows.create({type: "popup"}, pass(function(window) { | 104 chrome.windows.create({type: "popup"}, pass(function(window) { |
107 assertEq("popup", window.type); | 105 assertEq("popup", window.type); |
108 assertTrue(!window.incognito); | 106 assertTrue(!window.incognito); |
109 })); | 107 })); |
110 chrome.windows.create({incognito: true}, pass(function(window) { | 108 chrome.windows.create({incognito: true}, pass(function(window) { |
111 // This extension is not incognito-enabled, so it shouldn't be able to | 109 // This extension is not incognito-enabled, so it shouldn't be able to |
112 // see the incognito window. | 110 // see the incognito window. |
113 assertEq(null, window); | 111 assertEq(null, window); |
114 })); | 112 })); |
115 }, | 113 }, |
116 | 114 |
117 /* Disabled -- see http://bugs.chromium.org/58229. | 115 /* Disabled -- see http://bugs.chromium.org/58229. |
118 function windowSetFocused() { | 116 function windowSetFocused() { |
119 chrome.windows.getCurrent(function(oldWin) { | 117 chrome.windows.getCurrent(function(oldWin) { |
120 chrome.windows.create({}, function(newWin) { | 118 chrome.windows.create({}, function(newWin) { |
121 assertTrue(newWin.focused); | 119 assertTrue(newWin.focused); |
122 chrome.windows.update(oldWin.id, {focused:true}); | 120 chrome.windows.update(oldWin.id, {focused:true}); |
123 chrome.windows.get(oldWin.id, pass(function(oldWin2) { | 121 chrome.windows.get(oldWin.id, pass(function(oldWin2) { |
124 assertTrue(oldWin2.focused); | 122 assertTrue(oldWin2.focused); |
125 })); | 123 })); |
126 }); | 124 }); |
127 }); | 125 }); |
128 }, | 126 }, |
129 */ | 127 */ |
130 ]); | 128 ]); |
131 </script> | 129 </script> |
OLD | NEW |