OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * Expected files shown in Downloads with hidden enabled | 8 * Expected files shown in Downloads with hidden enabled |
9 * | 9 * |
10 * @type {!Array<!TestEntryInfo>} | 10 * @type {!Array<!TestEntryInfo>} |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 * hidden | 59 * hidden |
60 * @return {!Array} The test steps to toggle hidden files | 60 * @return {!Array} The test steps to toggle hidden files |
61 */ | 61 */ |
62 function getTestCaseStepsForHiddenFiles(basicSet, hiddenEntrySet) { | 62 function getTestCaseStepsForHiddenFiles(basicSet, hiddenEntrySet) { |
63 var appId; | 63 var appId; |
64 return [ | 64 return [ |
65 function(id) { | 65 function(id) { |
66 appId = id; | 66 appId = id; |
67 remoteCall.waitForElement(appId, '#gear-button').then(this.next); | 67 remoteCall.waitForElement(appId, '#gear-button').then(this.next); |
68 }, | 68 }, |
69 // Click the gear menu. | 69 // Open the gear menu by clicking the gear button. |
70 function() { | 70 function() { |
71 remoteCall.callRemoteTestUtil( | 71 remoteCall.callRemoteTestUtil( |
72 'fakeMouseClick', appId, ['#gear-button'], this.next); | 72 'fakeMouseClick', appId, ['#gear-button'], this.next); |
73 }, | 73 }, |
74 // Wait for menu to not be hidden. | 74 // Wait for menu to not be hidden. |
75 function(result) { | 75 function(result) { |
76 chrome.test.assertTrue(result); | 76 chrome.test.assertTrue(result); |
77 remoteCall.waitForElement(appId, '#gear-menu:not([hidden])') | 77 remoteCall.waitForElement(appId, '#gear-menu:not([hidden])') |
78 .then(this.next); | 78 .then(this.next); |
79 }, | 79 }, |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 testcase.hideGoogleDocs = function() { | 215 testcase.hideGoogleDocs = function() { |
216 var appId; | 216 var appId; |
217 StepsRunner.run([ | 217 StepsRunner.run([ |
218 function() { | 218 function() { |
219 setupAndWaitUntilReady(null, RootPath.DRIVE).then(this.next); | 219 setupAndWaitUntilReady(null, RootPath.DRIVE).then(this.next); |
220 }, | 220 }, |
221 function(results) { | 221 function(results) { |
222 appId = results.windowId; | 222 appId = results.windowId; |
223 remoteCall.waitForElement(appId, '#gear-button').then(this.next); | 223 remoteCall.waitForElement(appId, '#gear-button').then(this.next); |
224 }, | 224 }, |
225 // Click the gear menu. | 225 // Open the gear meny by a shortcut (Alt-E). |
226 function() { | 226 function() { |
227 remoteCall.callRemoteTestUtil( | 227 remoteCall.fakeKeyDown(appId, 'body', 'U+0045', false, false, true) |
228 'fakeMouseDown', appId, ['#gear-button'], this.next); | 228 .then(this.next); |
229 }, | 229 }, |
230 // Wait for menu to appear. | 230 // Wait for menu to appear. |
231 function(result) { | 231 function(result) { |
232 chrome.test.assertTrue(result); | 232 chrome.test.assertTrue(result); |
233 remoteCall.waitForElement(appId, '#gear-menu').then(this.next); | 233 remoteCall.waitForElement(appId, '#gear-menu').then(this.next); |
234 }, | 234 }, |
235 // Wait for menu to appear. | 235 // Wait for menu to appear. |
236 function(result) { | 236 function(result) { |
237 remoteCall.waitForElement(appId, | 237 remoteCall.waitForElement(appId, |
238 '#gear-menu-drive-hosted-settings:not([disabled])').then(this.next); | 238 '#gear-menu-drive-hosted-settings:not([disabled])').then(this.next); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 function(result) { | 271 function(result) { |
272 remoteCall.waitForFiles(appId, TestEntryInfo.getExpectedRows( | 272 remoteCall.waitForFiles(appId, TestEntryInfo.getExpectedRows( |
273 BASIC_DRIVE_ENTRY_SET), {ignoreFileSize: true, | 273 BASIC_DRIVE_ENTRY_SET), {ignoreFileSize: true, |
274 ignoreLastModifiedTime: true}).then(this.next); | 274 ignoreLastModifiedTime: true}).then(this.next); |
275 }, | 275 }, |
276 function() { | 276 function() { |
277 checkIfNoErrorsOccured(this.next); | 277 checkIfNoErrorsOccured(this.next); |
278 }, | 278 }, |
279 ]); | 279 ]); |
280 }; | 280 }; |
OLD | NEW |