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

Side by Side Diff: ui/file_manager/integration_tests/file_manager/folder_shortcuts.js

Issue 1056433003: Add button to add new FSP services to Files app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed tests. Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « ui/file_manager/integration_tests/file_manager/file_display.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 * Constants for selectors. 8 * Constants for selectors.
9 */ 9 */
10 var TREEITEM_DRIVE = '#directory-tree > div:nth-child(1) > .tree-children ' + 10 var TREEITEM_DRIVE = '#directory-tree > div:nth-child(1) > .tree-children ' +
11 '> div:nth-child(1) '; 11 '> div:nth-child(1) ';
12 var TREEITEM_A = TREEITEM_DRIVE + '> .tree-children > div:nth-child(1) '; 12 var TREEITEM_A = TREEITEM_DRIVE + '> .tree-children > div:nth-child(1) ';
13 var TREEITEM_B = TREEITEM_A + '> .tree-children > div:nth-child(1) '; 13 var TREEITEM_B = TREEITEM_A + '> .tree-children > div:nth-child(1) ';
14 var TREEITEM_C = TREEITEM_B + '> .tree-children > div:nth-child(1) '; 14 var TREEITEM_C = TREEITEM_B + '> .tree-children > div:nth-child(1) ';
15 var TREEITEM_D = TREEITEM_DRIVE + '> .tree-children > div:nth-child(2) '; 15 var TREEITEM_D = TREEITEM_DRIVE + '> .tree-children > div:nth-child(2) ';
16 var TREEITEM_E = TREEITEM_D + '> .tree-children > div:nth-child(1) '; 16 var TREEITEM_E = TREEITEM_D + '> .tree-children > div:nth-child(1) ';
17 var EXPAND_ICON = '> .tree-row > .expand-icon'; 17 var EXPAND_ICON = '> .tree-row > .expand-icon';
18 var VOLUME_ICON = '> .tree-row > .volume-icon'; 18 var ITEM_ICON = '> .tree-row > .item-icon';
19 var EXPANDED_SUBTREE = '> .tree-children[expanded]'; 19 var EXPANDED_SUBTREE = '> .tree-children[expanded]';
20 20
21 /** 21 /**
22 * Entry set which is used for this test. 22 * Entry set which is used for this test.
23 * @type {Array.<TestEntryInfo>} 23 * @type {Array.<TestEntryInfo>}
24 * @const 24 * @const
25 */ 25 */
26 var ENTRY_SET = [ 26 var ENTRY_SET = [
27 ENTRIES.directoryA, 27 ENTRIES.directoryA,
28 ENTRIES.directoryB, 28 ENTRIES.directoryB,
29 ENTRIES.directoryC, 29 ENTRIES.directoryC,
30 ENTRIES.directoryD, 30 ENTRIES.directoryD,
31 ENTRIES.directoryE, 31 ENTRIES.directoryE,
32 ENTRIES.directoryF 32 ENTRIES.directoryF
33 ]; 33 ];
34 34
35 /** 35 /**
36 * Constants for each folders. 36 * Constants for each folders.
37 * @type {Array.<Object>} 37 * @type {Array.<Object>}
38 * @const 38 * @const
39 */ 39 */
40 var DIRECTORY = { 40 var DIRECTORY = {
41 Drive: { 41 Drive: {
42 contents: [ENTRIES.directoryA.getExpectedRow(), 42 contents: [ENTRIES.directoryA.getExpectedRow(),
43 ENTRIES.directoryD.getExpectedRow()], 43 ENTRIES.directoryD.getExpectedRow()],
44 name: 'Drive', 44 name: 'Drive',
45 navItem: '#tree-item-autogen-id-2', 45 navItem: '#tree-item-autogen-id-3',
46 treeItem: TREEITEM_DRIVE 46 treeItem: TREEITEM_DRIVE
47 }, 47 },
48 A: { 48 A: {
49 contents: [ENTRIES.directoryB.getExpectedRow()], 49 contents: [ENTRIES.directoryB.getExpectedRow()],
50 name: 'A', 50 name: 'A',
51 navItem: '#tree-item-autogen-id-13', 51 navItem: '#tree-item-autogen-id-14',
52 treeItem: TREEITEM_A 52 treeItem: TREEITEM_A
53 }, 53 },
54 B: { 54 B: {
55 contents: [ENTRIES.directoryC.getExpectedRow()], 55 contents: [ENTRIES.directoryC.getExpectedRow()],
56 name: 'B', 56 name: 'B',
57 treeItem: TREEITEM_B 57 treeItem: TREEITEM_B
58 }, 58 },
59 C: { 59 C: {
60 contents: [], 60 contents: [],
61 name: 'C', 61 name: 'C',
62 navItem: '#tree-item-autogen-id-13', 62 navItem: '#tree-item-autogen-id-14',
63 treeItem: TREEITEM_C 63 treeItem: TREEITEM_C
64 }, 64 },
65 D: { 65 D: {
66 contents: [ENTRIES.directoryE.getExpectedRow()], 66 contents: [ENTRIES.directoryE.getExpectedRow()],
67 name: 'D', 67 name: 'D',
68 navItem: '#tree-item-autogen-id-12', 68 navItem: '#tree-item-autogen-id-13',
69 treeItem: TREEITEM_D 69 treeItem: TREEITEM_D
70 }, 70 },
71 E: { 71 E: {
72 contents: [ENTRIES.directoryF.getExpectedRow()], 72 contents: [ENTRIES.directoryF.getExpectedRow()],
73 name: 'E', 73 name: 'E',
74 treeItem: TREEITEM_E 74 treeItem: TREEITEM_E
75 } 75 }
76 }; 76 };
77 77
78 /** 78 /**
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 } 127 }
128 128
129 /** 129 /**
130 * Makes |directory| the current directory. 130 * Makes |directory| the current directory.
131 * @param {string} windowId ID of target window. 131 * @param {string} windowId ID of target window.
132 * @param {Object} directory Directory which should be a current directory. 132 * @param {Object} directory Directory which should be a current directory.
133 * @return {Promise} Promise fulfilled on success. 133 * @return {Promise} Promise fulfilled on success.
134 */ 134 */
135 function navigateToDirectory(windowId, directory) { 135 function navigateToDirectory(windowId, directory) {
136 return remoteCall.waitForElement( 136 return remoteCall.waitForElement(
137 windowId, directory.treeItem + VOLUME_ICON).then(function() { 137 windowId, directory.treeItem + ITEM_ICON).then(function() {
138 return remoteCall.callRemoteTestUtil( 138 return remoteCall.callRemoteTestUtil(
139 'fakeMouseClick', windowId, [directory.treeItem + VOLUME_ICON]); 139 'fakeMouseClick', windowId, [directory.treeItem + ITEM_ICON]);
140 }).then(function(result) { 140 }).then(function(result) {
141 chrome.test.assertTrue(result); 141 chrome.test.assertTrue(result);
142 return remoteCall.waitForFiles(windowId, directory.contents); 142 return remoteCall.waitForFiles(windowId, directory.contents);
143 }); 143 });
144 } 144 }
145 145
146 /** 146 /**
147 * Creates folder shortcut to |directory|. 147 * Creates folder shortcut to |directory|.
148 * The current directory must be a parent of the |directory|. 148 * The current directory must be a parent of the |directory|.
149 * @param {string} windowId ID of target window. 149 * @param {string} windowId ID of target window.
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 remoteCall.waitForElement(windowId1, TREEITEM_D + '[selected]'). 392 remoteCall.waitForElement(windowId1, TREEITEM_D + '[selected]').
393 then(this.next); 393 then(this.next);
394 }, 394 },
395 395
396 function() { 396 function() {
397 checkIfNoErrorsOccured(this.next); 397 checkIfNoErrorsOccured(this.next);
398 } 398 }
399 ]); 399 ]);
400 }; 400 };
401 401
OLDNEW
« no previous file with comments | « ui/file_manager/integration_tests/file_manager/file_display.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698