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

Unified Diff: chrome/test/data/file_manager/unit_tests/test_util.js

Issue 663513003: Add an unittest for background/volume_manager.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed variables. Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/file_manager/unit_tests/test_util.js
diff --git a/chrome/test/data/file_manager/unit_tests/test_util.js b/chrome/test/data/file_manager/unit_tests/test_util.js
new file mode 100644
index 0000000000000000000000000000000000000000..0948b759cd9707e1d77a2f4a573894b6a23bf3be
--- /dev/null
+++ b/chrome/test/data/file_manager/unit_tests/test_util.js
@@ -0,0 +1,21 @@
+// Copyright 2014 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.
+
+/**
+ * Invokes a callback function depending on the result of promise.
+ *
+ * @param {Promise} promise Promise.
+ * @param {function(boolean)} calllback Callback function. True is passed if the
+ * test failed.
+ */
+function reportPromise(promise, callback) {
+ promise.then(function() {
+ callback(/* error */ false);
+ }, function(error) {
+ console.error(error.stack || error);
+ callback(/* error */ true);
+ });
+}
+
+
hirono 2014/10/30 09:35:50 nit: The last line is not needed.
yawano 2014/10/30 10:18:30 Done.

Powered by Google App Engine
This is Rietveld 408576698