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

Unified Diff: chrome/test/data/file_manager/unit_tests/mocks/mock_progress_center.js

Issue 98363003: Files.app: Add a unit test of ProgressCenterHandler class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/file_manager/unit_tests/mocks/mock_progress_center.js
diff --git a/chrome/test/data/file_manager/unit_tests/mocks/mock_progress_center.js b/chrome/test/data/file_manager/unit_tests/mocks/mock_progress_center.js
new file mode 100644
index 0000000000000000000000000000000000000000..b0570362b7ee621838724b41303e9d77edc71695
--- /dev/null
+++ b/chrome/test/data/file_manager/unit_tests/mocks/mock_progress_center.js
@@ -0,0 +1,34 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+'use strict';
+
+/**
+ * Mock of Progress Center.
+ * @constructor
+ */
+function MockProgressCenter() {
+ /**
+ * Items stored in the progress center.
+ * @type {Object.<string, ProgressCenterItem>}
+ */
+ this.items = {};
+
+ Object.seal(this);
+}
+
+/**
+ * Stores an item to the progress center.
+ * @param {ProgressCenterItem} item Progress center item to be stored.
+ */
+MockProgressCenter.prototype.updateItem = function(item) {
+ this.items[item.id] = item;
+};
+
+/**
+ * Obtains an item stored in the progress center.
+ * @param {string} id ID spcifying the progress item.
+ */
+MockProgressCenter.prototype.getItemById = function(id) {
+ return this.items[id];
+};

Powered by Google App Engine
This is Rietveld 408576698