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
3 // found in the LICENSE file.
8 * Test utility for traverse tests.
9 * @param {string} path Root path to be traversed.
11 function traverseDirectories(path) {
14 // Set up File Manager. Do not add initial files.
16 openNewWindow(null, path, this.next);
18 // Check the initial view.
21 remoteCall.waitForElement(appId, '#detail-table').then(this.next);
24 addEntries(['local', 'drive'], NESTED_ENTRY_SET, this.next);
27 chrome.test.assertTrue(result);
28 remoteCall.waitForFiles(appId, [ENTRIES.directoryA.getExpectedRow()]).
33 remoteCall.callRemoteTestUtil('openFile', appId, ['A'], this.next);
35 // Check the contents of current directory.
37 chrome.test.assertTrue(result);
38 remoteCall.waitForFiles(appId, [ENTRIES.directoryB.getExpectedRow()]).
43 remoteCall.callRemoteTestUtil('openFile', appId, ['B'], this.next);
45 // Check the contents of current directory.
47 chrome.test.assertTrue(result);
48 remoteCall.waitForFiles(appId, [ENTRIES.directoryC.getExpectedRow()]).
53 checkIfNoErrorsOccured(this.next);
59 * Tests to traverse local directories.
61 testcase.traverseDownloads = function() {
62 traverseDirectories(RootPath.DOWNLOADS);
66 * Tests to traverse drive directories.
68 testcase.traverseDrive = function() {
69 traverseDirectories(RootPath.DRIVE);