Chromium Code Reviews| 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.
|