OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 'use strict'; |
| 5 |
| 6 /** |
| 7 * Mock of Progress Center. |
| 8 * @constructor |
| 9 */ |
| 10 function MockProgressCenter() { |
| 11 /** |
| 12 * Items stored in the progress center. |
| 13 * @type {Object.<string, ProgressCenterItem>} |
| 14 */ |
| 15 this.items = {}; |
| 16 |
| 17 Object.seal(this); |
| 18 } |
| 19 |
| 20 /** |
| 21 * Stores an item to the progress center. |
| 22 * @param {ProgressCenterItem} item Progress center item to be stored. |
| 23 */ |
| 24 MockProgressCenter.prototype.updateItem = function(item) { |
| 25 this.items[item.id] = item; |
| 26 }; |
| 27 |
| 28 /** |
| 29 * Obtains an item stored in the progress center. |
| 30 * @param {string} id ID spcifying the progress item. |
| 31 */ |
| 32 MockProgressCenter.prototype.getItemById = function(id) { |
| 33 return this.items[id]; |
| 34 }; |
OLD | NEW |