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

Side by Side Diff: chrome/test/chromedriver/extension/background.js

Issue 114403005: Adding a LaunchApp command to Chromedriver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing to latest code Created 6 years, 11 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 /* 5 /*
6 * Checks for an extension error that occurred during the asynchronous call. 6 * Checks for an extension error that occurred during the asynchronous call.
7 * If an error occurs, will invoke the error callback and throw an exception. 7 * If an error occurs, will invoke the error callback and throw an exception.
8 * 8 *
9 * @param {function(!Error)} errCallback The callback to invoke for error 9 * @param {function(!Error)} errCallback The callback to invoke for error
10 * reporting. 10 * reporting.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 */ 64 */
65 function updateWindow(updateInfo, callback, errCallback) { 65 function updateWindow(updateInfo, callback, errCallback) {
66 chrome.windows.getCurrent({}, function(window) { 66 chrome.windows.getCurrent({}, function(window) {
67 checkForExtensionError(errCallback); 67 checkForExtensionError(errCallback);
68 chrome.windows.update(window.id, updateInfo, function(window) { 68 chrome.windows.update(window.id, updateInfo, function(window) {
69 checkForExtensionError(errCallback); 69 checkForExtensionError(errCallback);
70 callback(); 70 callback();
71 }); 71 });
72 }); 72 });
73 } 73 }
74
75 /**
76 * Launches an app with the specified id.
77 *
78 * @param {Object} Id The ID of the app to launch
chrisgao (Use stgao instead) 2014/01/07 23:36:36 string instead of an Object? nit: comment ends wit
bustamante 2014/01/13 21:19:29 Done.
79 * @param {function()} callback Invoked when the updating is complete.
chrisgao (Use stgao instead) 2014/01/07 23:36:36 It seems the comment is not correct.
bustamante 2014/01/13 21:19:29 Yeah copy/paste error, Done.
80 * @param {function(!Error)} errCallback The callback to invoke for error
81 * reporting.
82 */
83 function launchApp(Id, callback, errCallback) {
84 chrome.management.launchApp(Id, function() {
85 checkForExtensionError(errCallback);
86 callback();
87 });
88 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698