summaryrefslogtreecommitdiffstats
path: root/ui/file_manager/integration_tests/gallery/background.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/file_manager/integration_tests/gallery/background.js')
-rw-r--r--ui/file_manager/integration_tests/gallery/background.js29
1 files changed, 1 insertions, 28 deletions
diff --git a/ui/file_manager/integration_tests/gallery/background.js b/ui/file_manager/integration_tests/gallery/background.js
index f507799..ffaba3d 100644
--- a/ui/file_manager/integration_tests/gallery/background.js
+++ b/ui/file_manager/integration_tests/gallery/background.js
@@ -54,33 +54,6 @@ function launch(testVolumeName, volumeType, entries, opt_selected) {
}
/**
- * Verifies if there are no Javascript errors in any of the app windows.
- * @param {function()} Completion callback.
- */
-function checkIfNoErrorsOccured(callback) {
- var countPromise = gallery.callRemoteTestUtil('getErrorCount', null, []);
- countPromise.then(function(count) {
- chrome.test.assertEq(0, count, 'The error count is not 0.');
- callback();
- });
-}
-
-/**
- * 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);
- });
-};
-
-/**
* Namespace for test cases.
*/
var testcase = {};
@@ -118,7 +91,7 @@ window.addEventListener('load', function() {
// Specify the name of test to the test system.
targetTest.generatedName = testCaseName;
chrome.test.runTests([function() {
- return testPromise(targetTest());
+ return testPromiseAndApps(targetTest(), [gallery]);
}]);
}
];