Index: chrome/test/data/extensions/api_test/file_manager_browsertest/background.js |
diff --git a/chrome/test/data/extensions/api_test/file_manager_browsertest/background.js b/chrome/test/data/extensions/api_test/file_manager_browsertest/background.js |
index 0ac4292cbd709a083592963e27dde606de3de39e..12ef690a6008d9eec649b329fadbb3433a3147e9 100644 |
--- a/chrome/test/data/extensions/api_test/file_manager_browsertest/background.js |
+++ b/chrome/test/data/extensions/api_test/file_manager_browsertest/background.js |
@@ -319,6 +319,21 @@ function waitUntilTaskExecutes(windowId, taskId) { |
} |
/** |
+ * Adds check of chrome.test to the end of the given promise. |
+ * @param {Promise} promise Promise. |
+ */ |
+function testPromise(promise) { |
+ promise.then(function() { |
+ return new Promise(checkIfNoErrorsOccured); |
+ }).then(chrome.test.callbackPass(function() { |
+ // The callbacPass is necessary to avoid prematurely finishing tests. |
+ // Don't put chrome.test.succeed() here to avoid doubled success log. |
+ }), function(error) { |
+ chrome.test.fail(error.stack || error); |
+ }); |
+}; |
+ |
+/** |
* Sends a fake key down event. |
* @param {string} windowId Window ID. |
* @param {string} query Query for the target element. |