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

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

Issue 15984003: Add tests for the video player in Files.app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 7 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 fd2a7cb7c7118b940be4a7725e87fe36437a0ffd..3bf80fad5399b63a2abf090c1ed0022304490ad4 100644
--- a/chrome/browser/resources/file_manager/js/test_util.js
+++ b/chrome/browser/resources/file_manager/js/test_util.js
@@ -157,6 +157,27 @@ test.util.getFileList = function(contentWindow) {
};
/**
+ * Waits until the window is set to the specified dimensions.
+ *
+ * @param {Window} contentWindow Window to be tested.
+ * @param {number} width Requested width.
+ * @param {number} height Requested height.
+ * @param {function(Object)} callback Success callback with the dimensions.
+ */
+test.util.waitForWindowGeometry = function(
+ contentWindow, width, height, callback) {
+ function helper() {
+ if (contentWindow.innerWidth == width &&
+ contentWindow.innerHeight == height) {
+ callback({width: width, height: height});
+ return;
+ }
+ window.setTimeout(helper, 50);
+ }
+ helper();
+};
+
+/**
* Waits for an element and returns it as an array of it's attributes.
*
* @param {Window} contentWindow Window to be tested.
@@ -529,6 +550,10 @@ test.util.registerRemoteTestUtils = function() {
case 'getFileList':
sendResponse(test.util.getFileList(contentWindow));
return false;
+ case 'waitForWindowGeometry':
+ test.util.waitForWindowGeometry(
+ contentWindow, request.args[0], request.args[1], sendResponse);
+ return true;
case 'waitForElement':
test.util.waitForElement(
contentWindow, request.args[0], request.args[1], sendResponse);

Powered by Google App Engine
This is Rietveld 408576698