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

Unified Diff: ui/file_manager/integration_tests/file_manager/quick_view.js

Issue 2080613002: Quick View: Add a test that checks Quick View opens with Space key. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 4 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: ui/file_manager/integration_tests/file_manager/quick_view.js
diff --git a/ui/file_manager/integration_tests/file_manager/quick_view.js b/ui/file_manager/integration_tests/file_manager/quick_view.js
new file mode 100644
index 0000000000000000000000000000000000000000..033d52d24a056eb386ed7ff1f389662fef329be8
--- /dev/null
+++ b/ui/file_manager/integration_tests/file_manager/quick_view.js
@@ -0,0 +1,56 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+'use strict';
+
+/**
+ * Tests opening the Quick View.
+ */
+testcase.openQuickView = function() {
+ var appId;
+
+ StepsRunner.run([
+ function() {
+ setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next);
+ },
+ function(results) {
+ appId = results.windowId;
+ // Select an image file.
+ remoteCall.callRemoteTestUtil(
+ 'selectFile', appId, ['My Desktop Background.png'], this.next);
+ },
+ function(results) {
+ chrome.test.assertTrue(results);
+ // Press Space key.
+ remoteCall.callRemoteTestUtil(
+ 'fakeKeyDown', appId,
+ ['#file-list', ' ', ' ', false, false, false], this.next);
+ },
+ function(results) {
+ chrome.test.assertTrue(results);
+
+ // Wait until Quick View is displayed.
+ repeatUntil(function() {
+ return remoteCall
+ .callRemoteTestUtil(
+ 'deepQueryAllElements', appId,
+ [['#quick-view', '#dialog'], null, ['display']])
+ .then(function(results) {
+ chrome.test.assertEq(1, results.length);
+ if (results[0].styles.display === 'none') {
+ return pending('Quick View is not opened yet.');
+ };
+ return results;
+ });
+ }).then(this.next);
+ },
+ function(results) {
+ chrome.test.assertEq(1, results.length);
+ // Check Quick View dialog is displayed.
+ chrome.test.assertEq('block', results[0].styles.display);
+
+ checkIfNoErrorsOccured(this.next);
+ },
+ ]);
+};

Powered by Google App Engine
This is Rietveld 408576698