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

Side by Side Diff: remoting/webapp/base.js

Issue 273753002: Implement 3 PIN browser tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Last iteration Created 6 years, 7 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
« no previous file with comments | « remoting/remoting_webapp_files.gypi ('k') | remoting/webapp/browser_test/browser_test.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 * @fileoverview 6 * @fileoverview
7 * A module that contains basic utility components and methods for the 7 * A module that contains basic utility components and methods for the
8 * chromoting project 8 * chromoting project
9 * 9 *
10 */ 10 */
11 11
12 'use strict'; 12 'use strict';
13 13
14 var base = {}; 14 var base = {};
15 base.debug = function () {}; 15 base.debug = function() {};
16 16
17 /** 17 /**
18 * Whether to break in debugger and alert when an assertion fails. 18 * Whether to break in debugger and alert when an assertion fails.
19 * Set it to true for debugging. 19 * Set it to true for debugging.
20 * @type {boolean} 20 * @type {boolean}
21 */ 21 */
22 base.debug.breakOnAssert = false; 22 base.debug.breakOnAssert = false;
23 23
24 /** 24 /**
25 * Assert that |expr| is true else print the |opt_msg|. 25 * Assert that |expr| is true else print the |opt_msg|.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 base.mix(dest.prototype, src.prototype || src); 97 base.mix(dest.prototype, src.prototype || src);
98 }; 98 };
99 99
100 base.doNothing = function() {}; 100 base.doNothing = function() {};
101 101
102 /** 102 /**
103 * Returns an array containing the values of |dict|. 103 * Returns an array containing the values of |dict|.
104 * @param {!Object} dict 104 * @param {!Object} dict
105 * @return {Array} 105 * @return {Array}
106 */ 106 */
107 base.values = function (dict) { 107 base.values = function(dict) {
108 return Object.keys(dict).map( 108 return Object.keys(dict).map(
109 /** @param {string} key */ 109 /** @param {string} key */
110 function(key) { 110 function(key) {
111 return dict[key]; 111 return dict[key];
112 }); 112 });
113 }; 113 };
114 114
115 base.Promise = function() {};
116
117 /**
118 * @param {number} delay
119 * @return {Promise} a Promise that will be fulfilled after |delay| ms.
120 */
121 base.Promise.sleep = function(delay) {
122 return new Promise(
123 /** @param {function():void} fulfill */
124 function(fulfill) {
125 window.setTimeout(fulfill, delay);
126 });
127 };
128
115 /** 129 /**
116 * A mixin for classes with events. 130 * A mixin for classes with events.
117 * 131 *
118 * For example, to create an alarm event for SmokeDetector: 132 * For example, to create an alarm event for SmokeDetector:
119 * functionSmokeDetector() { 133 * functionSmokeDetector() {
120 * this.defineEvents(['alarm']); 134 * this.defineEvents(['alarm']);
121 * }; 135 * };
122 * base.extend(SmokeDetector, base.EventSource); 136 * base.extend(SmokeDetector, base.EventSource);
123 * 137 *
124 * To fire an event: 138 * To fire an event:
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 246
233 listeners.forEach( 247 listeners.forEach(
234 /** @param {function(*=):void} listener */ 248 /** @param {function(*=):void} listener */
235 function(listener){ 249 function(listener){
236 if (listener) { 250 if (listener) {
237 listener(opt_details); 251 listener(opt_details);
238 } 252 }
239 }); 253 });
240 } 254 }
241 }; 255 };
OLDNEW
« no previous file with comments | « remoting/remoting_webapp_files.gypi ('k') | remoting/webapp/browser_test/browser_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698