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

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

Issue 177443006: [AudioPlayer] Add test for opening another file from Files.app (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/background/js/test_util.js
diff --git a/chrome/browser/resources/file_manager/background/js/test_util.js b/chrome/browser/resources/file_manager/background/js/test_util.js
index 075bb3fe09641a0df0540e7c4e1c2169196b2e32..ffb1fb8c7a42a21913ee994cc87e965582553a4c 100644
--- a/chrome/browser/resources/file_manager/background/js/test_util.js
+++ b/chrome/browser/resources/file_manager/background/js/test_util.js
@@ -111,6 +111,31 @@ test.util.async.waitForWindow = function(appIdPrefix, callback) {
};
/**
+ * Close the specified window and wait until it closes.
hirono 2014/03/04 09:14:13 nit: Closes
yoshiki 2014/03/05 02:24:44 Done.
+ *
+ * @param {string} appId AppId of window to be closed.
+ * @param {function(boolean)} callback Completion callback with the result. True
+ * if success, false otherwise.
+ */
+test.util.async.closeWindow = function(appId, callback) {
+ if (appId in background.appWindows &&
+ background.appWindows[appId].contentWindow) {
+ background.appWindows[appId].close();
+
+ test.util.repeatUntilTrue_(function() {
+ if (appId in background.appWindows) {
+ return false;
+ } else {
+ callback(true);
+ return true;
+ }
+ });
+ } else {
+ callback(false);
+ }
+};
+
+/**
* Gets a document in the Files.app's window, including iframes.
*
* @param {Window} contentWindow Window to be used.

Powered by Google App Engine
This is Rietveld 408576698