Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 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 * Invokes a callback function depending on the result of promise. | |
| 7 * | |
| 8 * @param {Promise} promise Promise. | |
| 9 * @param {function(boolean)} calllback Callback function. True is passed if the | |
| 10 * test failed. | |
| 11 */ | |
| 12 function reportPromise(promise, callback) { | |
| 13 promise.then(function() { | |
| 14 callback(/* error */ false); | |
| 15 }, function(error) { | |
| 16 console.error(error.stack || error); | |
| 17 callback(/* error */ true); | |
| 18 }); | |
| 19 } | |
| 20 | |
| 21 | |
|
hirono
2014/10/30 09:35:50
nit: The last line is not needed.
yawano
2014/10/30 10:18:30
Done.
| |
| OLD | NEW |