Commit a076b615 authored by Sam McNally's avatar Sam McNally Committed by Commit Bot

Convert keyboard_operations.js to use async-await.

Bug: 909056
Change-Id: I0ee41c828ba5c27c174dc51ade20d7b5fb6f0e80
Reviewed-on: https://chromium-review.googlesource.com/c/1351325Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Commit-Queue: Sam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612524}
parent b1a3ae3d
...@@ -11,19 +11,19 @@ ...@@ -11,19 +11,19 @@
* @param {string} appId The Files app windowId. * @param {string} appId The Files app windowId.
* @return {Promise} Promise to be fulfilled after clicking the OK button. * @return {Promise} Promise to be fulfilled after clicking the OK button.
*/ */
function waitAndAcceptDialog(appId) { async function waitAndAcceptDialog(appId) {
const okButton = '.cr-dialog-ok'; const okButton = '.cr-dialog-ok';
return new Promise(function(resolve) {
// Wait for the Ok button to appear. // Wait for the Ok button to appear.
remoteCall.waitForElement(appId, okButton).then(resolve); await remoteCall.waitForElement(appId, okButton);
}).then(function() {
// Click the Ok button. // Click the Ok button.
return remoteCall.callRemoteTestUtil('fakeMouseClick', appId, [okButton]); chrome.test.assertTrue(
}).then(function(result) { await remoteCall.callRemoteTestUtil('fakeMouseClick', appId, [okButton]),
chrome.test.assertTrue(result, 'Dialog Ok button click failed'); 'Dialog Ok button click failed');
// Wait until the dialog closes.
return remoteCall.waitForElementLost(appId, '.cr-dialog-container'); // Wait until the dialog closes.
}); await remoteCall.waitForElementLost(appId, '.cr-dialog-container');
} }
/** /**
...@@ -45,14 +45,11 @@ function getVisibleDirectoryTreeItemNames(appId) { ...@@ -45,14 +45,11 @@ function getVisibleDirectoryTreeItemNames(appId) {
*/ */
function waitForDirectoryTreeItem(appId, name) { function waitForDirectoryTreeItem(appId, name) {
let caller = getCaller(); let caller = getCaller();
return repeatUntil(function() { return repeatUntil(async () => {
return getVisibleDirectoryTreeItemNames(appId).then(function(names) { if ((await getVisibleDirectoryTreeItemNames(appId)).indexOf(name) !== -1) {
if (names.indexOf(name) !== -1) { return true;
return true; }
} else { return pending(caller, 'Directory tree item %s not found.', name);
return pending(caller, 'Directory tree item %s not found.', name);
}
});
}); });
} }
...@@ -65,14 +62,11 @@ function waitForDirectoryTreeItem(appId, name) { ...@@ -65,14 +62,11 @@ function waitForDirectoryTreeItem(appId, name) {
*/ */
function waitForDirectoryTreeItemLost(appId, name) { function waitForDirectoryTreeItemLost(appId, name) {
let caller = getCaller(); let caller = getCaller();
return repeatUntil(function() { return repeatUntil(async () => {
return getVisibleDirectoryTreeItemNames(appId).then(function(names) { if ((await getVisibleDirectoryTreeItemNames(appId)).indexOf(name) === -1) {
if (names.indexOf(name) === -1) { return true;
return true; }
} else { return pending(caller, 'Directory tree item %s still exists.', name);
return pending(caller, 'Directory tree item %s still exists.', name);
}
});
}); });
} }
...@@ -81,30 +75,22 @@ function waitForDirectoryTreeItemLost(appId, name) { ...@@ -81,30 +75,22 @@ function waitForDirectoryTreeItemLost(appId, name) {
* *
* @param {string} path The path to be tested, Downloads or Drive. * @param {string} path The path to be tested, Downloads or Drive.
*/ */
function keyboardCopy(path) { async function keyboardCopy(path) {
let appId; const {appId} = await setupAndWaitUntilReady(
null, path, null, [ENTRIES.world], [ENTRIES.world]);
return new Promise(function(resolve) {
setupAndWaitUntilReady( // Copy the file into the same file list.
null, path, resolve, [ENTRIES.world], [ENTRIES.world]); chrome.test.assertTrue(
}).then(function(results) { await remoteCall.callRemoteTestUtil('copyFile', appId, ['world.ogv']),
appId = results.windowId; 'copyFile failed');
// Copy the file into the same file list. // Check: the copied file should appear in the file list.
return remoteCall.callRemoteTestUtil('copyFile', appId, ['world.ogv']); const expectedEntryRows = [ENTRIES.world.getExpectedRow()].concat(
}).then(function(result) { [['world (1).ogv', '59 KB', 'OGG video']]);
chrome.test.assertTrue(result, 'copyFile failed'); await remoteCall.waitForFiles(
// Check: the copied file should appear in the file list. appId, expectedEntryRows, {ignoreLastModifiedTime: true});
const expectedEntryRows = [ENTRIES.world.getExpectedRow()].concat( const files = await remoteCall.callRemoteTestUtil('getFileList', appId, []);
[['world (1).ogv', '59 KB', 'OGG video']]); // The mtimes should not match.
return remoteCall.waitForFiles( chrome.test.assertTrue(files[0][3] != files[1][3], files[1][3]);
appId, expectedEntryRows, {ignoreLastModifiedTime: true});
}).then(() => {
return remoteCall.callRemoteTestUtil(
'getFileList', appId, []);
}).then(function(files) {
// The mtimes should not match.
chrome.test.assertTrue(files[0][3] != files[1][3], files[1][3]);
});
} }
/** /**
...@@ -112,24 +98,20 @@ function keyboardCopy(path) { ...@@ -112,24 +98,20 @@ function keyboardCopy(path) {
* *
* @param {string} path The path to be tested, Downloads or Drive. * @param {string} path The path to be tested, Downloads or Drive.
*/ */
function keyboardDelete(path) { async function keyboardDelete(path) {
let appId; const {appId} = await setupAndWaitUntilReady(
null, path, null, [ENTRIES.hello], [ENTRIES.hello]);
return new Promise(function(resolve) {
setupAndWaitUntilReady( // Delete the file from the file list.
null, path, resolve, [ENTRIES.hello], [ENTRIES.hello]); chrome.test.assertTrue(
}).then(function(results) { await remoteCall.callRemoteTestUtil('deleteFile', appId, ['hello.txt']),
appId = results.windowId; 'deleteFile failed');
// Delete the file from the file list.
return remoteCall.callRemoteTestUtil('deleteFile', appId, ['hello.txt']); // Run the delete entry confirmation dialog.
}).then(function(result) { await waitAndAcceptDialog(appId);
chrome.test.assertTrue(result, 'deleteFile failed');
// Run the delete entry confirmation dialog. // Check: the file list should be empty.
return waitAndAcceptDialog(appId); await remoteCall.waitForFiles(appId, []);
}).then(function() {
// Check: the file list should be empty.
return remoteCall.waitForFiles(appId, []);
});
} }
/** /**
...@@ -139,33 +121,29 @@ function keyboardDelete(path) { ...@@ -139,33 +121,29 @@ function keyboardDelete(path) {
* @param {string} path The path to be tested, Downloads or Drive. * @param {string} path The path to be tested, Downloads or Drive.
* @param {string} treeItem The directory tree item selector. * @param {string} treeItem The directory tree item selector.
*/ */
function keyboardDeleteFolder(path, treeItem) { async function keyboardDeleteFolder(path, treeItem) {
let appId; const {appId} = await setupAndWaitUntilReady(
null, path, null, [ENTRIES.photos], [ENTRIES.photos]);
return new Promise(function(resolve) {
setupAndWaitUntilReady( // Expand the directory tree |treeItem|.
null, path, resolve, [ENTRIES.photos], [ENTRIES.photos]); await expandRoot(appId, treeItem);
}).then(function(results) {
appId = results.windowId; // Check: the folder should be shown in the directory tree.
// Expand the directory tree |treeItem|. await waitForDirectoryTreeItem(appId, 'photos');
return expandRoot(appId, treeItem);
}).then(function() { // Delete the folder entry from the file list.
// Check: the folder should be shown in the directory tree. chrome.test.assertTrue(
return waitForDirectoryTreeItem(appId, 'photos'); await remoteCall.callRemoteTestUtil('deleteFile', appId, ['photos']),
}).then(function() { 'deleteFile failed');
// Delete the folder entry from the file list.
return remoteCall.callRemoteTestUtil('deleteFile', appId, ['photos']); // Run the delete entry confirmation dialog.
}).then(function(result) { await waitAndAcceptDialog(appId);
chrome.test.assertTrue(result, 'deleteFile failed');
// Run the delete entry confirmation dialog. // Check: the file list should be empty.
return waitAndAcceptDialog(appId); await remoteCall.waitForFiles(appId, []);
}).then(function() {
// Check: the file list should be empty. // Check: the folder should not be shown in the directory tree.
return remoteCall.waitForFiles(appId, []); await waitForDirectoryTreeItemLost(appId, 'photos');
}).then(function() {
// Check: the folder should not be shown in the directory tree.
return waitForDirectoryTreeItemLost(appId, 'photos');
});
} }
/** /**
...@@ -176,32 +154,29 @@ function keyboardDeleteFolder(path, treeItem) { ...@@ -176,32 +154,29 @@ function keyboardDeleteFolder(path, treeItem) {
* @param {string} newName New name of a file. * @param {string} newName New name of a file.
* @return {Promise} Promise to be fulfilled on success. * @return {Promise} Promise to be fulfilled on success.
*/ */
function renameFile(appId, oldName, newName) { async function renameFile(appId, oldName, newName) {
const textInput = '#file-list .table-row[renaming] input.rename'; const textInput = '#file-list .table-row[renaming] input.rename';
return Promise.resolve().then(function() { // Select the file.
// Select the file. chrome.test.assertTrue(
return remoteCall.callRemoteTestUtil('selectFile', appId, [oldName]); await remoteCall.callRemoteTestUtil('selectFile', appId, [oldName]),
}).then(function(result) { 'selectFile failed');
chrome.test.assertTrue(result, 'selectFile failed');
// Press Ctrl+Enter key to rename the file. // Press Ctrl+Enter key to rename the file.
const key = ['#file-list', 'Enter', true, false, false]; const key = ['#file-list', 'Enter', true, false, false];
return remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key); chrome.test.assertTrue(
}).then(function(result) { await remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key));
chrome.test.assertTrue(result);
// Check: the renaming text input should be shown in the file list. // Check: the renaming text input should be shown in the file list.
return remoteCall.waitForElement(appId, textInput); await remoteCall.waitForElement(appId, textInput);
}).then(function() {
// Type new file name. // Type new file name.
return remoteCall.callRemoteTestUtil( await remoteCall.callRemoteTestUtil('inputText', appId, [textInput, newName]);
'inputText', appId, [textInput, newName]);
}).then(function() { // Send Enter key to the text input.
// Send Enter key to the text input. const key2 = [textInput, 'Enter', false, false, false];
const key = [textInput, 'Enter', false, false, false]; chrome.test.assertTrue(
return remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key); await remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key2));
}).then(function(result) {
chrome.test.assertTrue(result);
});
} }
/** /**
...@@ -212,147 +187,133 @@ function renameFile(appId, oldName, newName) { ...@@ -212,147 +187,133 @@ function renameFile(appId, oldName, newName) {
* @param {string} treeItem The directory tree item selector. * @param {string} treeItem The directory tree item selector.
* @return {Promise} Promise to be fulfilled on success. * @return {Promise} Promise to be fulfilled on success.
*/ */
function testRenameFolder(path, treeItem) { async function testRenameFolder(path, treeItem) {
let appId;
const textInput = '#file-list .table-row[renaming] input.rename'; const textInput = '#file-list .table-row[renaming] input.rename';
const {appId} = await setupAndWaitUntilReady(
return new Promise(function(resolve) { null, path, null, [ENTRIES.photos], [ENTRIES.photos]);
setupAndWaitUntilReady(
null, path, resolve, [ENTRIES.photos], [ENTRIES.photos]); // Expand the directory tree |treeItem|.
}).then(function(results) { await expandRoot(appId, treeItem);
// Expand the directory tree |treeItem|.
appId = results.windowId; // Check: the photos folder should be shown in the directory tree.
return expandRoot(appId, treeItem); await waitForDirectoryTreeItem(appId, 'photos');
}).then(function() { chrome.test.assertTrue(
// Check: the photos folder should be shown in the directory tree. await remoteCall.callRemoteTestUtil('focus', appId, ['#file-list']));
return waitForDirectoryTreeItem(appId, 'photos');
}).then(function() { // Press ArrowDown to select the photos folder.
// Focus the file-list. const select = ['#file-list', 'ArrowDown', false, false, false];
return remoteCall.callRemoteTestUtil('focus', appId, ['#file-list']); chrome.test.assertTrue(
}).then(function(result) { await remoteCall.callRemoteTestUtil('fakeKeyDown', appId, select));
chrome.test.assertTrue(result);
// Press ArrowDown to select the photos folder. // Await file list item selection.
const select = ['#file-list', 'ArrowDown', false, false, false]; const selectedItem = '#file-list .table-row[selected]';
return remoteCall.callRemoteTestUtil('fakeKeyDown', appId, select); await remoteCall.waitForElement(appId, selectedItem);
}).then(function(result) {
chrome.test.assertTrue(result); // Press Ctrl+Enter to rename the photos folder.
// Await file list item selection. let key = ['#file-list', 'Enter', true, false, false];
const selectedItem = '#file-list .table-row[selected]'; chrome.test.assertTrue(
return remoteCall.waitForElement(appId, selectedItem); await remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key));
}).then(function() {
// Press Ctrl+Enter to rename the photos folder. // Check: the renaming text input should be shown in the file list.
const key = ['#file-list', 'Enter', true, false, false]; await remoteCall.waitForElement(appId, textInput);
return remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key);
}).then(function(result) { // Type the new folder name.
chrome.test.assertTrue(result); await remoteCall.callRemoteTestUtil(
// Check: the renaming text input should be shown in the file list. 'inputText', appId, [textInput, 'bbq photos']);
return remoteCall.waitForElement(appId, textInput);
}).then(function() { // Send Enter to the list to attempt to enter the directory.
// Type the new folder name. key = ['#list-container', 'Enter', false, false, false];
return remoteCall.callRemoteTestUtil( chrome.test.assertTrue(
'inputText', appId, [textInput, 'bbq photos']); await remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key));
}).then(function() {
// Send Enter to the list to attempt to enter the directory. // Send Enter to the text input to complete renaming.
const key = ['#list-container', 'Enter', false, false, false]; key = [textInput, 'Enter', false, false, false];
return remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key); chrome.test.assertTrue(
}).then(function(result) { await remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key));
chrome.test.assertTrue(result);
// Send Enter to the text input to complete renaming. // Wait until renaming is complete.
const key = [textInput, 'Enter', false, false, false]; const renamingItem = '#file-list .table-row[renaming]';
return remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key); await remoteCall.waitForElementLost(appId, renamingItem);
}).then(function(result) {
chrome.test.assertTrue(result); // Check: the renamed folder should be shown in the file list.
// Wait until renaming is complete. const expectedRows = [['bbq photos', '--', 'Folder', '']];
const renamingItem = '#file-list .table-row[renaming]'; await remoteCall.waitForFiles(
return remoteCall.waitForElementLost(appId, renamingItem); appId, expectedRows, {ignoreLastModifiedTime: true});
}).then(function() {
// Check: the renamed folder should be shown in the file list. // Check: the renamed folder should be shown in the directory tree.
const expectedRows = [['bbq photos', '--', 'Folder', '']]; await waitForDirectoryTreeItem(appId, 'bbq photos');
return remoteCall.waitForFiles(
appId, expectedRows, {ignoreLastModifiedTime: true});
}).then(function() {
// Check: the renamed folder should be shown in the directory tree.
return waitForDirectoryTreeItem(appId, 'bbq photos');
});
} }
/** /**
* Tests renaming a file. * Tests renaming a file.
* *
* @param {string} path Initial path (Downloads or Drive). * @param {string} path Initial path (Downloads or Drive).
* @return {Promise} Promise to be fulfilled on success. * @return {Promise} Promise to be fulfilled on success.
*/ */
function testRenameFile(path) { async function testRenameFile(path) {
let appId;
const newFile = [['New File Name.txt', '51 bytes', 'Plain text', '']]; const newFile = [['New File Name.txt', '51 bytes', 'Plain text', '']];
return new Promise(function(resolve) { const {appId} = await setupAndWaitUntilReady(
setupAndWaitUntilReady( null, path, null, [ENTRIES.hello], [ENTRIES.hello]);
null, path, resolve, [ENTRIES.hello], [ENTRIES.hello]);
}).then(function(results) { // Rename the file.
// Rename the file. await renameFile(appId, 'hello.txt', 'New File Name.txt');
appId = results.windowId;
return renameFile(appId, 'hello.txt', 'New File Name.txt'); // Wait until renaming completes.
}).then(function() { await remoteCall.waitForElementLost(appId, '#file-list [renaming]');
// Wait until renaming completes.
return remoteCall.waitForElementLost(appId, '#file-list [renaming]'); // Check: the new file name should be shown in the file list.
}).then(function() { await remoteCall.waitForFiles(appId, newFile, {ignoreLastModifiedTime: true});
// Check: the new file name should be shown in the file list.
return remoteCall.waitForFiles( // Try renaming the new file to an invalid file name.
appId, newFile, {ignoreLastModifiedTime: true}); await renameFile(appId, 'New File Name.txt', '.hidden file');
}).then(function() {
// Try renaming the new file to an invalid file name. // Check: the error dialog should be shown.
return renameFile(appId, 'New File Name.txt', '.hidden file'); await waitAndAcceptDialog(appId);
}).then(function() {
// Check: the error dialog should be shown. // Check: the new file name should not be changed.
return waitAndAcceptDialog(appId); await remoteCall.waitForFiles(appId, newFile, {ignoreLastModifiedTime: true});
}).then(function() {
// Check: the new file name should not be changed.
return remoteCall.waitForFiles(
appId, newFile, {ignoreLastModifiedTime: true});
});
} }
testcase.keyboardCopyDownloads = function() { testcase.keyboardCopyDownloads = function() {
testPromise(keyboardCopy(RootPath.DOWNLOADS)); return keyboardCopy(RootPath.DOWNLOADS);
}; };
testcase.keyboardCopyDrive = function() { testcase.keyboardCopyDrive = function() {
testPromise(keyboardCopy(RootPath.DRIVE)); return keyboardCopy(RootPath.DRIVE);
}; };
testcase.keyboardDeleteDownloads = function() { testcase.keyboardDeleteDownloads = function() {
testPromise(keyboardDelete(RootPath.DOWNLOADS)); return keyboardDelete(RootPath.DOWNLOADS);
}; };
testcase.keyboardDeleteDrive = function() { testcase.keyboardDeleteDrive = function() {
testPromise(keyboardDelete(RootPath.DRIVE)); return keyboardDelete(RootPath.DRIVE);
}; };
testcase.keyboardDeleteFolderDownloads = function() { testcase.keyboardDeleteFolderDownloads = function() {
testPromise(keyboardDeleteFolder(RootPath.DOWNLOADS, TREEITEM_DOWNLOADS)); return keyboardDeleteFolder(RootPath.DOWNLOADS, TREEITEM_DOWNLOADS);
}; };
testcase.keyboardDeleteFolderDrive = function() { testcase.keyboardDeleteFolderDrive = function() {
testPromise(keyboardDeleteFolder(RootPath.DRIVE, TREEITEM_DRIVE)); return keyboardDeleteFolder(RootPath.DRIVE, TREEITEM_DRIVE);
}; };
testcase.renameFileDownloads = function() { testcase.renameFileDownloads = function() {
testPromise(testRenameFile(RootPath.DOWNLOADS)); return testRenameFile(RootPath.DOWNLOADS);
}; };
testcase.renameFileDrive = function() { testcase.renameFileDrive = function() {
testPromise(testRenameFile(RootPath.DRIVE)); return testRenameFile(RootPath.DRIVE);
}; };
testcase.renameNewFolderDownloads = function() { testcase.renameNewFolderDownloads = function() {
testPromise(testRenameFolder(RootPath.DOWNLOADS, TREEITEM_DOWNLOADS)); return testRenameFolder(RootPath.DOWNLOADS, TREEITEM_DOWNLOADS);
}; };
testcase.renameNewFolderDrive = function() { testcase.renameNewFolderDrive = function() {
testPromise(testRenameFolder(RootPath.DRIVE, TREEITEM_DRIVE)); return testRenameFolder(RootPath.DRIVE, TREEITEM_DRIVE);
}; };
/** /**
...@@ -392,67 +353,41 @@ testcase.keyboardSelectDriveDirectoryTree = async function() { ...@@ -392,67 +353,41 @@ testcase.keyboardSelectDriveDirectoryTree = async function() {
* Tests that while the delete dialog is displayed, it is not possible to press * Tests that while the delete dialog is displayed, it is not possible to press
* CONTROL-C to copy a file. * CONTROL-C to copy a file.
*/ */
testcase.keyboardDisableCopyWhenDialogDisplayed = function() { testcase.keyboardDisableCopyWhenDialogDisplayed = async function() {
let appId = null; // Open Files app.
const {appId} = await setupAndWaitUntilReady(
StepsRunner.run([ null, RootPath.DOWNLOADS, null, [ENTRIES.hello], []);
// Open Files app.
function() { // Select a file for deletion.
setupAndWaitUntilReady( chrome.test.assertTrue(
null, RootPath.DOWNLOADS, this.next, [ENTRIES.hello], []); !!await remoteCall.callRemoteTestUtil('selectFile', appId, ['hello.txt']),
}, 'selectFile failed');
// Select a file for deletion. await remoteCall.waitForElement(appId, '.table-row[selected]');
function(result) {
appId = result.windowId; // Click delete button in the toolbar.
remoteCall.callRemoteTestUtil( await remoteCall.callRemoteTestUtil(
'selectFile', appId, ['hello.txt'], this.next); 'fakeMouseClick', appId, ['button#delete-button']);
},
// Wait for the entry to be selected. // Confirm that the delete confirmation dialog is shown.
function(result) { await remoteCall.waitForElement(appId, '.cr-dialog-container.shown');
chrome.test.assertTrue(!!result, 'selectFile failed');
remoteCall.waitForElement(appId, '.table-row[selected]').then(this.next); // Try to copy file. We need to use execCommand as the command handler that
}, // interprets key strokes will drop events if there is a dialog on screen.
// Start delete to bring up the delete dialog. chrome.test.assertTrue(
function(result) { await remoteCall.callRemoteTestUtil('execCommand', appId, ['copy']));
// Click delete button in the toolbar.
remoteCall.callRemoteTestUtil( // Press Cancel button to stop the delete operation.
'fakeMouseClick', appId, ['button#delete-button'], this.next); chrome.test.assertTrue(await remoteCall.callRemoteTestUtil(
}, 'fakeMouseClick', appId, ['button.cr-dialog-cancel']));
// Confirm that the delete confirmation dialog is shown.
function(result) { // Wait for dialog to disappear.
remoteCall.waitForElement(appId, '.cr-dialog-container.shown') chrome.test.assertTrue(
.then(this.next); await remoteCall.waitForElementLost(appId, '.cr-dialog-container.shown'));
}, const key = ['#file-list', 'v', true, false, false];
// Try to copy file. We need to use execCommand as the command handler that chrome.test.assertTrue(
// interprets key strokes will drop events if there is a dialog on screen. await remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key));
function() {
remoteCall.callRemoteTestUtil('execCommand', appId, ['copy'], this.next); // Check no files were pasted.
}, const files = TestEntryInfo.getExpectedRows([ENTRIES.hello]);
// Press Cancel button to stop the delete operation. await remoteCall.waitForFiles(appId, files);
function(result) {
chrome.test.assertTrue(result);
remoteCall.callRemoteTestUtil(
'fakeMouseClick', appId, ['button.cr-dialog-cancel'], this.next);
},
// Wait for dialog to disappear.
function(result) {
chrome.test.assertTrue(result);
remoteCall.waitForElementLost(appId, '.cr-dialog-container.shown')
.then(this.next);
},
function(result) {
chrome.test.assertTrue(result);
const key = ['#file-list', 'v', true, false, false];
remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key).then(this.next);
},
// Check no files were pasted.
function(result) {
chrome.test.assertTrue(result);
const files = TestEntryInfo.getExpectedRows([ENTRIES.hello]);
remoteCall.waitForFiles(appId, files).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