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. // Wait until the dialog closes.
return remoteCall.waitForElementLost(appId, '.cr-dialog-container'); 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(
null, path, resolve, [ENTRIES.world], [ENTRIES.world]);
}).then(function(results) {
appId = results.windowId;
// Copy the file into the same file list. // Copy the file into the same file list.
return remoteCall.callRemoteTestUtil('copyFile', appId, ['world.ogv']); chrome.test.assertTrue(
}).then(function(result) { await remoteCall.callRemoteTestUtil('copyFile', appId, ['world.ogv']),
chrome.test.assertTrue(result, 'copyFile failed'); 'copyFile failed');
// Check: the copied file should appear in the file list. // Check: the copied file should appear in the file list.
const expectedEntryRows = [ENTRIES.world.getExpectedRow()].concat( const expectedEntryRows = [ENTRIES.world.getExpectedRow()].concat(
[['world (1).ogv', '59 KB', 'OGG video']]); [['world (1).ogv', '59 KB', 'OGG video']]);
return remoteCall.waitForFiles( await remoteCall.waitForFiles(
appId, expectedEntryRows, {ignoreLastModifiedTime: true}); appId, expectedEntryRows, {ignoreLastModifiedTime: true});
}).then(() => { const files = await remoteCall.callRemoteTestUtil('getFileList', appId, []);
return remoteCall.callRemoteTestUtil(
'getFileList', appId, []);
}).then(function(files) {
// The mtimes should not match. // The mtimes should not match.
chrome.test.assertTrue(files[0][3] != files[1][3], files[1][3]); 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(
null, path, resolve, [ENTRIES.hello], [ENTRIES.hello]);
}).then(function(results) {
appId = results.windowId;
// Delete the file from the file list. // Delete the file from the file list.
return remoteCall.callRemoteTestUtil('deleteFile', appId, ['hello.txt']); chrome.test.assertTrue(
}).then(function(result) { await remoteCall.callRemoteTestUtil('deleteFile', appId, ['hello.txt']),
chrome.test.assertTrue(result, 'deleteFile failed'); 'deleteFile failed');
// Run the delete entry confirmation dialog. // Run the delete entry confirmation dialog.
return waitAndAcceptDialog(appId); await waitAndAcceptDialog(appId);
}).then(function() {
// Check: the file list should be empty. // Check: the file list should be empty.
return remoteCall.waitForFiles(appId, []); await 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(
null, path, resolve, [ENTRIES.photos], [ENTRIES.photos]);
}).then(function(results) {
appId = results.windowId;
// Expand the directory tree |treeItem|. // Expand the directory tree |treeItem|.
return expandRoot(appId, treeItem); await expandRoot(appId, treeItem);
}).then(function() {
// Check: the folder should be shown in the directory tree. // Check: the folder should be shown in the directory tree.
return waitForDirectoryTreeItem(appId, 'photos'); await waitForDirectoryTreeItem(appId, 'photos');
}).then(function() {
// Delete the folder entry from the file list. // Delete the folder entry from the file list.
return remoteCall.callRemoteTestUtil('deleteFile', appId, ['photos']); chrome.test.assertTrue(
}).then(function(result) { await remoteCall.callRemoteTestUtil('deleteFile', appId, ['photos']),
chrome.test.assertTrue(result, 'deleteFile failed'); 'deleteFile failed');
// Run the delete entry confirmation dialog. // Run the delete entry confirmation dialog.
return waitAndAcceptDialog(appId); await waitAndAcceptDialog(appId);
}).then(function() {
// Check: the file list should be empty. // Check: the file list should be empty.
return remoteCall.waitForFiles(appId, []); await remoteCall.waitForFiles(appId, []);
}).then(function() {
// Check: the folder should not be shown in the directory tree. // Check: the folder should not be shown in the directory tree.
return waitForDirectoryTreeItemLost(appId, 'photos'); await 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.
return remoteCall.callRemoteTestUtil('selectFile', appId, [oldName]); chrome.test.assertTrue(
}).then(function(result) { await remoteCall.callRemoteTestUtil('selectFile', appId, [oldName]),
chrome.test.assertTrue(result, 'selectFile failed'); '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 key = [textInput, 'Enter', false, false, false]; const key2 = [textInput, 'Enter', false, false, false];
return remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key); chrome.test.assertTrue(
}).then(function(result) { await remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key2));
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(
null, path, null, [ENTRIES.photos], [ENTRIES.photos]);
return new Promise(function(resolve) {
setupAndWaitUntilReady(
null, path, resolve, [ENTRIES.photos], [ENTRIES.photos]);
}).then(function(results) {
// Expand the directory tree |treeItem|. // Expand the directory tree |treeItem|.
appId = results.windowId; await expandRoot(appId, treeItem);
return expandRoot(appId, treeItem);
}).then(function() {
// Check: the photos folder should be shown in the directory tree. // Check: the photos folder should be shown in the directory tree.
return waitForDirectoryTreeItem(appId, 'photos'); await waitForDirectoryTreeItem(appId, 'photos');
}).then(function() { chrome.test.assertTrue(
// Focus the file-list. await remoteCall.callRemoteTestUtil('focus', appId, ['#file-list']));
return remoteCall.callRemoteTestUtil('focus', appId, ['#file-list']);
}).then(function(result) {
chrome.test.assertTrue(result);
// Press ArrowDown to select the photos folder. // Press ArrowDown to select the photos folder.
const select = ['#file-list', 'ArrowDown', false, false, false]; const select = ['#file-list', 'ArrowDown', false, false, false];
return remoteCall.callRemoteTestUtil('fakeKeyDown', appId, select); chrome.test.assertTrue(
}).then(function(result) { await remoteCall.callRemoteTestUtil('fakeKeyDown', appId, select));
chrome.test.assertTrue(result);
// Await file list item selection. // Await file list item selection.
const selectedItem = '#file-list .table-row[selected]'; const selectedItem = '#file-list .table-row[selected]';
return remoteCall.waitForElement(appId, selectedItem); await remoteCall.waitForElement(appId, selectedItem);
}).then(function() {
// Press Ctrl+Enter to rename the photos folder. // Press Ctrl+Enter to rename the photos folder.
const key = ['#file-list', 'Enter', true, false, false]; let 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 the new folder name. // Type the new folder name.
return remoteCall.callRemoteTestUtil( await remoteCall.callRemoteTestUtil(
'inputText', appId, [textInput, 'bbq photos']); 'inputText', appId, [textInput, 'bbq photos']);
}).then(function() {
// Send Enter to the list to attempt to enter the directory. // Send Enter to the list to attempt to enter the directory.
const key = ['#list-container', 'Enter', false, false, false]; key = ['#list-container', '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. // Send Enter to the text input to complete renaming.
const key = [textInput, '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);
// Wait until renaming is complete. // Wait until renaming is complete.
const renamingItem = '#file-list .table-row[renaming]'; const renamingItem = '#file-list .table-row[renaming]';
return remoteCall.waitForElementLost(appId, renamingItem); await remoteCall.waitForElementLost(appId, renamingItem);
}).then(function() {
// Check: the renamed folder should be shown in the file list. // Check: the renamed folder should be shown in the file list.
const expectedRows = [['bbq photos', '--', 'Folder', '']]; const expectedRows = [['bbq photos', '--', 'Folder', '']];
return remoteCall.waitForFiles( await remoteCall.waitForFiles(
appId, expectedRows, {ignoreLastModifiedTime: true}); appId, expectedRows, {ignoreLastModifiedTime: true});
}).then(function() {
// Check: the renamed folder should be shown in the directory tree. // Check: the renamed folder should be shown in the directory tree.
return waitForDirectoryTreeItem(appId, 'bbq photos'); await 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.
appId = results.windowId; await renameFile(appId, 'hello.txt', 'New File Name.txt');
return renameFile(appId, 'hello.txt', 'New File Name.txt');
}).then(function() {
// Wait until renaming completes. // Wait until renaming completes.
return remoteCall.waitForElementLost(appId, '#file-list [renaming]'); await remoteCall.waitForElementLost(appId, '#file-list [renaming]');
}).then(function() {
// Check: the new file name should be shown in the file list. // Check: the new file name should be shown in the file list.
return remoteCall.waitForFiles( await remoteCall.waitForFiles(appId, newFile, {ignoreLastModifiedTime: true});
appId, newFile, {ignoreLastModifiedTime: true});
}).then(function() {
// Try renaming the new file to an invalid file name. // Try renaming the new file to an invalid file name.
return renameFile(appId, 'New File Name.txt', '.hidden file'); await renameFile(appId, 'New File Name.txt', '.hidden file');
}).then(function() {
// Check: the error dialog should be shown. // Check: the error dialog should be shown.
return waitAndAcceptDialog(appId); await waitAndAcceptDialog(appId);
}).then(function() {
// Check: the new file name should not be changed. // Check: the new file name should not be changed.
return remoteCall.waitForFiles( await remoteCall.waitForFiles(appId, newFile, {ignoreLastModifiedTime: true});
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;
StepsRunner.run([
// Open Files app. // Open Files app.
function() { const {appId} = await setupAndWaitUntilReady(
setupAndWaitUntilReady( null, RootPath.DOWNLOADS, null, [ENTRIES.hello], []);
null, RootPath.DOWNLOADS, this.next, [ENTRIES.hello], []);
},
// Select a file for deletion. // Select a file for deletion.
function(result) { chrome.test.assertTrue(
appId = result.windowId; !!await remoteCall.callRemoteTestUtil('selectFile', appId, ['hello.txt']),
remoteCall.callRemoteTestUtil( 'selectFile failed');
'selectFile', appId, ['hello.txt'], this.next); await remoteCall.waitForElement(appId, '.table-row[selected]');
},
// Wait for the entry to be selected.
function(result) {
chrome.test.assertTrue(!!result, 'selectFile failed');
remoteCall.waitForElement(appId, '.table-row[selected]').then(this.next);
},
// Start delete to bring up the delete dialog.
function(result) {
// Click delete button in the toolbar. // Click delete button in the toolbar.
remoteCall.callRemoteTestUtil( await remoteCall.callRemoteTestUtil(
'fakeMouseClick', appId, ['button#delete-button'], this.next); 'fakeMouseClick', appId, ['button#delete-button']);
},
// Confirm that the delete confirmation dialog is shown. // Confirm that the delete confirmation dialog is shown.
function(result) { await remoteCall.waitForElement(appId, '.cr-dialog-container.shown');
remoteCall.waitForElement(appId, '.cr-dialog-container.shown')
.then(this.next);
},
// Try to copy file. We need to use execCommand as the command handler that // 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. // interprets key strokes will drop events if there is a dialog on screen.
function() { chrome.test.assertTrue(
remoteCall.callRemoteTestUtil('execCommand', appId, ['copy'], this.next); await remoteCall.callRemoteTestUtil('execCommand', appId, ['copy']));
},
// Press Cancel button to stop the delete operation. // Press Cancel button to stop the delete operation.
function(result) { chrome.test.assertTrue(await remoteCall.callRemoteTestUtil(
chrome.test.assertTrue(result); 'fakeMouseClick', appId, ['button.cr-dialog-cancel']));
remoteCall.callRemoteTestUtil(
'fakeMouseClick', appId, ['button.cr-dialog-cancel'], this.next);
},
// Wait for dialog to disappear. // Wait for dialog to disappear.
function(result) { chrome.test.assertTrue(
chrome.test.assertTrue(result); await remoteCall.waitForElementLost(appId, '.cr-dialog-container.shown'));
remoteCall.waitForElementLost(appId, '.cr-dialog-container.shown')
.then(this.next);
},
function(result) {
chrome.test.assertTrue(result);
const key = ['#file-list', 'v', true, false, false]; const key = ['#file-list', 'v', true, false, false];
remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key).then(this.next); chrome.test.assertTrue(
}, await remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key));
// Check no files were pasted. // Check no files were pasted.
function(result) {
chrome.test.assertTrue(result);
const files = TestEntryInfo.getExpectedRows([ENTRIES.hello]); const files = TestEntryInfo.getExpectedRows([ENTRIES.hello]);
remoteCall.waitForFiles(appId, files).then(this.next); await remoteCall.waitForFiles(appId, files);
},
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