Index: chrome/browser/resources/file_manager/js/test_util.js |
diff --git a/chrome/browser/resources/file_manager/js/test_util.js b/chrome/browser/resources/file_manager/js/test_util.js |
index 8a6071773c3d99488e2381fa658dba5d86139118..aa1ca01db6283ac7487c44d9d707c90808104be2 100644 |
--- a/chrome/browser/resources/file_manager/js/test_util.js |
+++ b/chrome/browser/resources/file_manager/js/test_util.js |
@@ -43,6 +43,20 @@ test.util.openMainWindow = function(path, callback) { |
}; |
/** |
+ * Gets total Javascript error count from each app window. |
+ * @return {number} Error count. |
+ */ |
+test.util.getErrorCount = function() { |
+ var totalCount = 0; |
+ for (var appId in appWindows) { |
+ var contentWindow = appWindows[appId].contentWindow; |
+ if (contentWindow.JSErrorCount) |
+ totalCount += contentWindow.JSErrorCount; |
+ } |
+ return totalCount; |
+}; |
+ |
+/** |
* Returns an array with the files currently selected in the file manager. |
* |
* @param {Window} contentWindow Window to be tested. |
@@ -307,6 +321,9 @@ test.util.registerRemoteTestUtils = function() { |
case 'openMainWindow': |
test.util.openMainWindow(request.args[0], sendResponse); |
return true; |
+ case 'getErrorCount': |
+ sendResponse(test.util.getErrorCount()); |
+ return true; |
default: |
console.error('Global function ' + request.func + ' not found.'); |
} |