| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 'use strict'; |
| 6 |
| 7 /** |
| 8 * Tests opening the Quick View. |
| 9 */ |
| 10 testcase.openQuickView = function() { |
| 11 var appId; |
| 12 |
| 13 StepsRunner.run([ |
| 14 function() { |
| 15 setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next); |
| 16 }, |
| 17 function(results) { |
| 18 appId = results.windowId; |
| 19 // Select an image file. |
| 20 remoteCall.callRemoteTestUtil( |
| 21 'selectFile', appId, ['My Desktop Background.png'], this.next); |
| 22 }, |
| 23 function(results) { |
| 24 chrome.test.assertTrue(results); |
| 25 // Press Space key. |
| 26 remoteCall.callRemoteTestUtil( |
| 27 'fakeKeyDown', appId, |
| 28 ['#file-list', ' ', ' ', false, false, false], this.next); |
| 29 }, |
| 30 function(results) { |
| 31 chrome.test.assertTrue(results); |
| 32 |
| 33 // Wait until Quick View is displayed. |
| 34 repeatUntil(function() { |
| 35 return remoteCall |
| 36 .callRemoteTestUtil( |
| 37 'deepQueryAllElements', appId, |
| 38 [['#quick-view', '#dialog'], null, ['display']]) |
| 39 .then(function(results) { |
| 40 chrome.test.assertEq(1, results.length); |
| 41 if (results[0].styles.display === 'none') { |
| 42 return pending('Quick View is not opened yet.'); |
| 43 }; |
| 44 return results; |
| 45 }); |
| 46 }).then(this.next); |
| 47 }, |
| 48 function(results) { |
| 49 chrome.test.assertEq(1, results.length); |
| 50 // Check Quick View dialog is displayed. |
| 51 chrome.test.assertEq('block', results[0].styles.display); |
| 52 |
| 53 checkIfNoErrorsOccured(this.next); |
| 54 }, |
| 55 ]); |
| 56 }; |
| OLD | NEW |