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

Side by Side Diff: chrome/test/data/webui/mock_timer.js

Issue 43593003: Add layout switcher for virtual keyboard. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix keyboard tests. Created 7 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 * Overrides timeout and interval callbacks to mock timing behavior. 6 * Overrides timeout and interval callbacks to mock timing behavior.
7 * @constructor 7 * @constructor
8 */ 8 */
9 function MockTimer() { 9 function MockTimer() {
10 /** 10 /**
11 * Default versions of the timing functions. 11 * Default versions of the timing functions.
12 * @type {Object.<string, !Function>} 12 * @type {Object.<string, !Function>}
13 * @private 13 * @private
14 */ 14 */
15 this.originals_ = []; 15 this.originals_ = [];
16 16
17 /** 17 /**
18 * Key to assign on the next creation of a scheduled timer. Each call to 18 * Key to assign on the next creation of a scheduled timer. Each call to
19 * setTimeout or setInterval returns a unique key that can be used for 19 * setTimeout or setInterval returns a unique key that can be used for
20 * clearing the timer. 20 * clearing the timer.
21 * @type {number} 21 * @type {number}
22 * @private 22 * @private
23 */ 23 */
24 this.nextTimerKey_ = 0; 24 this.nextTimerKey_ = 1;
25 25
26 /** 26 /**
27 * Details for active timers. 27 * Details for active timers.
28 * @type {Array.<{callback: Function, 28 * @type {Array.<{callback: Function,
29 * delay: number, 29 * delay: number,
30 * key: number, 30 * key: number,
31 * repeats: boolean}>} 31 * repeats: boolean}>}
32 * @private 32 * @private
33 */ 33 */
34 this.timers_ = []; 34 this.timers_ = [];
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 details.callback.apply(window); 200 details.callback.apply(window);
201 if (details.repeats) 201 if (details.repeats)
202 this.scheduleTask_(details); 202 this.scheduleTask_(details);
203 else 203 else
204 this.clearTimeout_(details.key); 204 this.clearTimeout_(details.key);
205 } 205 }
206 this.now_ = this.until_; 206 this.now_ = this.until_;
207 }, 207 },
208 208
209 }; 209 };
OLDNEW
« no previous file with comments | « chrome/test/data/chromeos/virtual_keyboard/keyset_transition_test.js ('k') | ui/keyboard/keyboard_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698