Commit 2292f913 authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

Add a QuickView openQuickViewMtp browser test

Add coverage for MTP to the openQuickView<VolumeType> test group, with
a test variation - the initial ephemeral volume (here MTP) mounts with
non-empty file content (BASIC_FAKE_ENTRY_SET).

Test: browser_test --gtest_filter="QuickView/FilesApp*"
Bug: 836254
Change-Id: I21562e5b4905c3b57609b11bd8f231a137ec8884
Reviewed-on: https://chromium-review.googlesource.com/1099096
Commit-Queue: Noel Gordon <noel@chromium.org>
Reviewed-by: default avatarJoel Hockey <joelhockey@chromium.org>
Reviewed-by: default avatarNaoki Fukino <fukino@chromium.org>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567605}
parent 6d1da9de
...@@ -224,6 +224,7 @@ WRAPPED_INSTANTIATE_TEST_CASE_P( ...@@ -224,6 +224,7 @@ WRAPPED_INSTANTIATE_TEST_CASE_P(
TestCase("openQuickView").TabletMode(), TestCase("openQuickView").TabletMode(),
TestCase("openQuickViewDrive"), TestCase("openQuickViewDrive"),
TestCase("openQuickViewUsb"), TestCase("openQuickViewUsb"),
TestCase("openQuickViewMtp"),
TestCase("closeQuickView"))); TestCase("closeQuickView")));
WRAPPED_INSTANTIATE_TEST_CASE_P( WRAPPED_INSTANTIATE_TEST_CASE_P(
......
...@@ -196,3 +196,49 @@ testcase.openQuickViewUsb = function() { ...@@ -196,3 +196,49 @@ testcase.openQuickViewUsb = function() {
}, },
]); ]);
}; };
/**
* Tests opening Quick View on an MTP file.
*/
testcase.openQuickViewMtp = function() {
let appId;
const MTP_VOLUME_QUERY = '#directory-tree [volume-type-icon="mtp"]';
StepsRunner.run([
// Open Files app on local Downloads.
function() {
setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next);
},
// Mount a non-empty MTP volume.
function(results) {
appId = results.windowId;
chrome.test.sendMessage(
JSON.stringify({name: 'mountFakeMtp'}), this.next);
},
// Wait for MTP volume to mount.
function() {
remoteCall.waitForElement(appId, MTP_VOLUME_QUERY).then(this.next);
},
// Click to open the MTP volume.
function() {
remoteCall.callRemoteTestUtil(
'fakeMouseClick', appId, [MTP_VOLUME_QUERY], this.next);
},
// Check: the expected files should appear in the MTP volume.
function(result) {
chrome.test.assertTrue(!!result, 'fakeMouseClick failed');
const files = TestEntryInfo.getExpectedRows(BASIC_FAKE_ENTRY_SET);
remoteCall.waitForFiles(appId, files, {ignoreLastModifiedTime: true})
.then(this.next);
},
// Open a file in Quick View.
function() {
const openSteps = openQuickViewSteps(appId, ENTRIES.hello.nameText);
StepsRunner.run(openSteps).then(this.next);
},
function() {
checkIfNoErrorsOccured(this.next);
},
]);
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment