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

Side by Side Diff: chrome/browser/resources/md_bookmarks/timer_proxy.js

Issue 2926763005: [MD Bookmarks] Refactor window timer mocking. (Closed)
Patch Set: address comments Created 3 years, 6 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * @fileoverview A class that mediates window timer calls to support mockability
7 * in tests.
8 */
9
10 cr.define('bookmarks', function() {
11 /** @constructor */
12 function TimerProxy() {}
13
14 TimerProxy.prototype = {
15 /**
16 * @param {Function|string} fn
17 * @param {number=} delay
18 * @return {number}
19 */
20 setTimeout: function(fn, delay) {
21 return window.setTimeout(fn, delay);
22 },
23
24 /** @param {number|undefined?} id */
25 clearTimeout: function(id) {
26 window.clearTimeout(id);
27 },
28 };
29
30 return {
31 TimerProxy: TimerProxy,
32 };
33 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/timer_proxy.html ('k') | chrome/browser/resources/md_bookmarks/toast_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698