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 * Tests if we can open and unmount a zip file.
9 * @param {string} path Directory path to be tested.
11 function zipOpen(path) {
16 addEntries(['local', 'drive'], [ENTRIES.zipArchive], this.next);
20 chrome.test.assertTrue(result);
21 openNewWindow(null, path, this.next);
23 // Wait for going back.
26 remoteCall.waitForElement(appId, '#detail-table').then(this.next);
29 remoteCall.waitForFiles(appId, [ENTRIES.zipArchive.getExpectedRow()]).
34 remoteCall.callRemoteTestUtil('openFile',
36 [ENTRIES.zipArchive.nameText],
39 // Wait for ZIP contents.
41 chrome.test.assertTrue(result);
42 remoteCall.waitForFiles(appId,
44 'SUCCESSFULLY_PERFORMED_FAKE_MOUNT.txt',
49 {ignoreLastModifiedTime: true}).then(this.next);
53 remoteCall.waitForElement(appId, '.root-eject', this.next).
58 remoteCall.callRemoteTestUtil('fakeMouseClick',
63 // Wait for going back.
65 chrome.test.assertTrue(result);
66 remoteCall.waitForFiles(appId, [ENTRIES.zipArchive.getExpectedRow()]).
70 checkIfNoErrorsOccured(this.next);
75 testcase.zipOpenDownloads = function() {
76 zipOpen(RootPath.DOWNLOADS);
79 testcase.zipOpenDrive = function() {
80 zipOpen(RootPath.DRIVE);