Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5749)

Unified Diff: chrome/browser/resources/file_manager/js/test_util.js

Issue 14367009: Fix Javascript errors occuring when a file is deleted during calculating it's size. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.');
}

Powered by Google App Engine
This is Rietveld 408576698