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

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

Issue 301733006: Zoom Extension API (chrome) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Create ZoomController for guest web contents. Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
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 testTabId; 5 var testTabId;
6 var otherTabId; 6 var otherTabId;
7 var firstWindowId; 7 var firstWindowId;
8 var secondWindowId; 8 var secondWindowId;
9 9
10 chrome.test.runTests([ 10 chrome.test.runTests([
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 callback(); 148 callback();
149 }); 149 });
150 chrome.tabs.move(tabId, properties); 150 chrome.tabs.move(tabId, properties);
151 }; 151 };
152 152
153 // Move tab to second window, then back to first. 153 // Move tab to second window, then back to first.
154 moveAndListen(testTabId, firstWindowId, 1, 154 moveAndListen(testTabId, firstWindowId, 1,
155 {"windowId": secondWindowId, "index": 0}, pass(function() { 155 {"windowId": secondWindowId, "index": 0}, pass(function() {
156 moveAndListen(testTabId, secondWindowId, 0, 156 moveAndListen(testTabId, secondWindowId, 0,
157 {"windowId": firstWindowId, "index": 1}); 157 {"windowId": firstWindowId, "index": 1});
158 })); 158 }));
159 },
160
161 function tabsOnZoomChange() {
162 chrome.tabs.setZoom(testTabId, 1, function() {
163 chrome.test.listenOnce(
164 chrome.tabs.onZoomChange,
165 function(tabId, oldZoomFactor, newZoomFactor, zoomSettings) {
166 assertEq(testTabId, tabId);
167 assertEq(1, oldZoomFactor);
168 assertEq(3.14159, +newZoomFactor.toFixed(5));
169 assertEq("automatic", zoomSettings.mode);
170 assertEq("per-origin", zoomSettings.scope);
171 });
172
173 chrome.tabs.setZoom(testTabId, 3.14159);
174 });
159 }, 175 },
160 176
161 function windowsOnCreated() { 177 function windowsOnCreated() {
162 chrome.test.listenOnce(chrome.windows.onCreated, function(window) { 178 chrome.test.listenOnce(chrome.windows.onCreated, function(window) {
163 assertTrue(window.width > 0); 179 assertTrue(window.width > 0);
164 assertTrue(window.height > 0); 180 assertTrue(window.height > 0);
165 assertEq("normal", window.type); 181 assertEq("normal", window.type);
166 assertTrue(!window.incognito); 182 assertTrue(!window.incognito);
167 windowEventsWindow = window; 183 windowEventsWindow = window;
168 chrome.tabs.getAllInWindow(window.id, pass(function(tabs) { 184 chrome.tabs.getAllInWindow(window.id, pass(function(tabs) {
(...skipping 21 matching lines...) Expand all
190 assertEq(windowEventsWindow.id, changedWindowId); 206 assertEq(windowEventsWindow.id, changedWindowId);
191 }); 207 });
192 chrome.windows.remove(windowB.id); 208 chrome.windows.remove(windowB.id);
193 })); 209 }));
194 })); 210 }));
195 })); 211 }));
196 })); 212 }));
197 } 213 }
198 */ 214 */
199 ]); 215 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698