Commit 4a551412 authored by Luciano Pacheco's avatar Luciano Pacheco Committed by Commit Bot

Remove keyIdentifier from fakeKeyDown test function

keyIdentifier is deprecated and replaced by "key" argument in
KeyboardEvent. Additionally our use of this was pretty inconsistent, so
removed it completely.

Change-Id: I35d6ba9660830b6c419f2a6e106bbde5162cf4b7
Reviewed-on: https://chromium-review.googlesource.com/1245080
Commit-Queue: Luciano Pacheco <lucmult@chromium.org>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594535}
parent 9d46e6e6
......@@ -92,13 +92,13 @@ test.util.sync.getFileList = function(contentWindow) {
test.util.sync.selectFile = function(contentWindow, filename) {
var rows = contentWindow.document.querySelectorAll('#detail-table li');
test.util.sync.fakeKeyDown(
contentWindow, '#file-list', 'Home', 'Home', false, false, false);
contentWindow, '#file-list', 'Home', false, false, false);
for (var index = 0; index < rows.length; ++index) {
var selection = test.util.sync.getSelectedFiles(contentWindow);
if (selection.length === 1 && selection[0] === filename)
return true;
test.util.sync.fakeKeyDown(
contentWindow, '#file-list', 'ArrowDown', 'Down', false, false, false);
contentWindow, '#file-list', 'ArrowDown', false, false, false);
}
console.error('Failed to select file "' + filename + '"');
return false;
......@@ -193,19 +193,17 @@ test.util.sync.selectFolderInTree = function(contentWindow, folderName) {
var items =
contentWindow.document.querySelectorAll('#directory-tree .tree-item');
test.util.sync.fakeKeyDown(
contentWindow, '#directory-tree', 'Home', 'Home', false, false, false);
contentWindow, '#directory-tree', 'Home', false, false, false);
for (var index = 0; index < items.length; ++index) {
var selectedTreeItemName =
test.util.sync.getSelectedTreeItem(contentWindow);
if (selectedTreeItemName === folderName) {
test.util.sync.fakeKeyDown(
contentWindow, '#directory-tree', 'Enter', 'Enter', false, false,
false);
contentWindow, '#directory-tree', 'Enter', false, false, false);
return true;
}
test.util.sync.fakeKeyDown(
contentWindow, '#directory-tree', 'ArrowDown', 'Down', false, false,
false);
contentWindow, '#directory-tree', 'ArrowDown', false, false, false);
}
console.error('Failed to select folder in tree "' + folderName + '"');
......@@ -228,7 +226,7 @@ test.util.sync.expandSelectedFolderInTree = function(contentWindow) {
}
test.util.sync.fakeKeyDown(
contentWindow, '#directory-tree .tree-item[selected]', 'ArrowRight',
'Right', false, false, false);
false, false, false);
return true;
};
......@@ -248,7 +246,7 @@ test.util.sync.collapseSelectedFolderInTree = function(contentWindow) {
}
test.util.sync.fakeKeyDown(
contentWindow, '#directory-tree .tree-item[selected]', 'ArrowLeft',
'Left', false, false, false);
false, false, false);
return true;
};
......@@ -339,9 +337,9 @@ test.util.sync.copyFile = function(contentWindow, filename) {
return false;
// Ctrl+C and Ctrl+V
test.util.sync.fakeKeyDown(
contentWindow, '#file-list', 'c', 'U+0043', true, false, false);
contentWindow, '#file-list', 'c', true, false, false);
test.util.sync.fakeKeyDown(
contentWindow, '#file-list', 'v', 'U+0056', true, false, false);
contentWindow, '#file-list', 'v', true, false, false);
return true;
};
......@@ -358,7 +356,7 @@ test.util.sync.deleteFile = function(contentWindow, filename) {
return false;
// Delete
test.util.sync.fakeKeyDown(
contentWindow, '#file-list', 'Delete', 'U+007F', false, false, false);
contentWindow, '#file-list', 'Delete', false, false, false);
return true;
};
......
......@@ -350,25 +350,23 @@ test.util.sync.fakeEvent = function(contentWindow,
/**
* Sends a fake key event to the element specified by |targetQuery| or active
* element with the given |keyIdentifier| and optional |ctrl| modifier.
* element with the given |key| and optional |ctrl,shift,alt| modifier.
*
* @param {Window} contentWindow Window to be tested.
* @param {?string} targetQuery Query to specify the element. If this value is
* null, key event is dispatched to active element of the document.
* @param {string} key DOM UI Events key value.
* @param {string} keyIdentifier Identifier of the emulated key.
* @param {boolean} ctrl Whether CTRL should be pressed, or not.
* @param {boolean} shift whether SHIFT should be pressed, or not.
* @param {boolean} alt whether ALT should be pressed, or not.
* @return {boolean} True if the event is sent to the target, false otherwise.
*/
test.util.sync.fakeKeyDown = function(
contentWindow, targetQuery, key, keyIdentifier, ctrl, shift, alt) {
contentWindow, targetQuery, key, ctrl, shift, alt) {
const event = new KeyboardEvent('keydown', {
bubbles: true,
composed: true, // Allow the event to bubble past shadow DOM root.
key: key,
keyIdentifier: keyIdentifier,
ctrlKey: ctrl,
shiftKey: shift,
altKey: alt
......
......@@ -16,7 +16,7 @@ quickview.openCloseQuickView = (file, opt_validate) => {
// changed to text file 'hello.txt'.
assertTrue(test.selectFile(file));
// Press Space key.
assertTrue(test.fakeKeyDown('#file-list', ' ', ' ', false, false, false));
assertTrue(test.fakeKeyDown('#file-list', ' ', false, false, false));
// Wait until Quick View is displayed and files-safe-media.src is set.
return test
.repeatUntil(() => {
......
......@@ -24,7 +24,7 @@ function selectFirstFileListItem(appId) {
return remoteCall.waitForElementLost(appId, '#file-list [selected]');
}).then(function() {
// Press DownArrow key to select an item.
const key = ['#file-list', 'ArrowDown', 'Down', false, false, false];
const key = ['#file-list', 'ArrowDown', false, false, false];
return remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key);
}).then(function(result) {
chrome.test.assertTrue(result);
......@@ -58,7 +58,7 @@ function createNewFolder(appId, initialEntrySet, selector) {
}).then(function(result) {
chrome.test.assertTrue(result);
// Press Ctrl+E to create a new folder.
const key = ['#file-list', 'e', 'U+0045', true, false, false];
const key = ['#file-list', 'e', true, false, false];
return remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key);
}).then(function(result) {
chrome.test.assertTrue(result);
......@@ -101,7 +101,7 @@ function createNewFolder(appId, initialEntrySet, selector) {
'inputText', appId, [textInput, 'Test Folder Name']);
}).then(function() {
// Press the Enter key.
const key = [textInput, 'Enter', 'Enter', false, false, false];
const key = [textInput, 'Enter', false, false, false];
return remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key);
}).then(function(result) {
chrome.test.assertTrue(result);
......
......@@ -87,7 +87,7 @@ function navigateToDestinationDirectoryAndTestPaste(windowId) {
// Paste
return remoteCall.callRemoteTestUtil(
'fakeKeyDown', windowId,
['body', 'v', 'U+0056' /* v */, true /* ctrl */, false, false]);
['body', 'v', true /* ctrl */, false, false]);
})
.then(function() {
// Confirm the photos directory is pasted correctly.
......@@ -104,7 +104,7 @@ function renamePhotosDirectoryTo(windowId, newName, useKeyboardShortcut) {
return (useKeyboardShortcut ?
remoteCall.callRemoteTestUtil(
'fakeKeyDown', windowId,
['body', 'Enter', 'Enter', true /* ctrl */, false, false]) :
['body', 'Enter', true /* ctrl */, false, false]) :
clickDirectoryTreeContextMenuItem(windowId, '/photos', 'rename')
).then(function() {
return remoteCall.waitForElement(windowId, '.tree-row > input');
......@@ -114,7 +114,7 @@ function renamePhotosDirectoryTo(windowId, newName, useKeyboardShortcut) {
}).then(function() {
return remoteCall.callRemoteTestUtil(
'fakeKeyDown', windowId,
['.tree-row > input', 'Enter', 'Enter', false, false, false]);
['.tree-row > input', 'Enter', false, false, false]);
});
}
......@@ -171,7 +171,7 @@ function createDirectoryFromDirectoryTree(
}).then(function() {
if (useKeyboardShortcut) {
return remoteCall.callRemoteTestUtil('fakeKeyDown', windowId,
['body', 'e', 'U+0045' /* e */, true /* ctrl */, false, false]);
['body', 'e', true /* ctrl */, false, false]);
} else {
return clickDirectoryTreeContextMenuItem(
windowId, '/photos', 'new-folder');
......@@ -184,7 +184,7 @@ function createDirectoryFromDirectoryTree(
}).then(function() {
return remoteCall.callRemoteTestUtil(
'fakeKeyDown', windowId,
['.tree-row > input', 'Enter', 'Enter', false, false, false]);
['.tree-row > input', 'Enter', false, false, false]);
}).then(function() {
// Confirm that new directory is added to the directory tree.
return remoteCall.waitForElement(
......@@ -228,7 +228,7 @@ testcase.dirCopyWithKeyboard = function() {
}).then(function() {
// Press Ctrl+C.
return remoteCall.callRemoteTestUtil('fakeKeyDown', windowId,
['body', 'c', 'U+0043' /* c */, true /* ctrl */, false, false]);
['body', 'c', true /* ctrl */, false, false]);
}).then(function() {
return navigateToDestinationDirectoryAndTestPaste(windowId);
}));
......@@ -281,7 +281,7 @@ testcase.dirCutWithKeyboard = function() {
}).then(function() {
// Press Ctrl+X.
return remoteCall.callRemoteTestUtil('fakeKeyDown', windowId,
['body', 'x', 'U+0058' /* x */, true /* ctrl */, false, false]);
['body', 'x', true /* ctrl */, false, false]);
}).then(function() {
return navigateToDestinationDirectoryAndTestPaste(windowId);
}).then(function() {
......@@ -325,7 +325,7 @@ testcase.dirPasteWithContextMenu = function() {
.then(function() {
return remoteCall.callRemoteTestUtil(
'fakeKeyDown', windowId,
['body', 'c', 'U+0043' /* c */, true /* ctrl */, false, false]);
['body', 'c', true /* ctrl */, false, false]);
})
.then(function() {
return remoteCall.navigateWithDirectoryTree(
......@@ -437,7 +437,7 @@ testcase.dirRenameUpdateChildrenBreadcrumbs = function() {
})
.then(function() {
const enterKey = [
'.tree-row > input', 'Enter', 'Enter', false, false, false
'.tree-row > input', 'Enter', false, false, false
];
return remoteCall.callRemoteTestUtil(
'fakeKeyDown', appId, enterKey);
......
......@@ -167,7 +167,7 @@ testcase.driveClickFirstSearchResult = function() {
appId = id;
remoteCall.callRemoteTestUtil(
'fakeKeyDown', appId,
['#autocomplete-list', 'ArrowDown', 'Down', false, false, false],
['#autocomplete-list', 'ArrowDown', false, false, false],
this.next);
},
function(result) {
......@@ -216,8 +216,7 @@ testcase.drivePressEnterToSearch = function() {
function(result) {
remoteCall.callRemoteTestUtil(
'fakeKeyDown', appId,
['#search-box cr-input', 'Enter', 'Enter', false, false, false],
this.next);
['#search-box cr-input', 'Enter', false, false, false], this.next);
},
function(result) {
remoteCall.waitForFileListChange(appId, BASIC_DRIVE_ENTRY_SET.length)
......@@ -330,7 +329,7 @@ testcase.drivePressCtrlAFromSearch = function() {
function(result) {
remoteCall.callRemoteTestUtil(
'fakeKeyDown', appId,
['#search-box cr-input', 'A', 'A', true, false, false], this.next);
['#search-box cr-input', 'A', true, false, false], this.next);
},
// Check we didn't enter check-select mode.
function(result) {
......
......@@ -176,7 +176,7 @@ function openFileDialogClickCancelButton(volume, name) {
function openFileDialogSendEscapeKey(volume, name) {
const type = {type: 'openFile'};
const escapeKey = ['#file-list', 'Escape', 'U+001B', false, false, false];
const escapeKey = ['#file-list', 'Escape', false, false, false];
let closer = sendOpenFileDialogKey.bind(null, name, escapeKey);
return createFileEntryPromise(volume)
......
......@@ -265,7 +265,7 @@ testcase.traverseFolderShortcuts = function() {
},
// Send Ctrl+3 key to file-list to select 3rd shortcut.
function() {
const key = ['#file-list', '3', '3', true, false, false];
const key = ['#file-list', '3', true, false, false];
remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key, this.next);
},
// Check: current directory and selection should be D.
......@@ -275,7 +275,7 @@ testcase.traverseFolderShortcuts = function() {
},
// Send UpArrow key to directory tree to select the shortcut above D.
function() {
const key = ['#directory-tree', 'ArrowUp', 'Up', false, false, false];
const key = ['#directory-tree', 'ArrowUp', false, false, false];
remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key, this.next);
},
// Check: current directory should be D, with shortcut C selected.
......@@ -285,7 +285,7 @@ testcase.traverseFolderShortcuts = function() {
},
// Send Enter key to the directory tree to change to directory C.
function() {
const key = ['#directory-tree', 'Enter', 'Enter', false, false, false];
const key = ['#directory-tree', 'Enter', false, false, false];
remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key, this.next);
},
// Check: current directory and selection should be C.
......
......@@ -269,7 +269,7 @@ testcase.toogleGoogleDocsDrive = function() {
},
// Open the gear meny by a shortcut (Alt-E).
function() {
remoteCall.fakeKeyDown(appId, 'body', 'e', 'U+0045', false, false, true)
remoteCall.fakeKeyDown(appId, 'body', 'e', false, false, true)
.then(this.next);
},
// Wait for menu to appear.
......@@ -548,7 +548,7 @@ testcase.showPasteIntoCurrentFolder = function() {
function(result) {
chrome.test.assertTrue(result);
remoteCall
.fakeKeyDown(appId, '#file-list', 'c', 'U+0043', true, false, false)
.fakeKeyDown(appId, '#file-list', 'c', true, false, false)
.then(this.next);
},
function() {
......
......@@ -179,7 +179,7 @@ function renameFile(appId, oldName, newName) {
}).then(function(result) {
chrome.test.assertTrue(result, 'selectFile failed');
// Press Ctrl+Enter key to rename the file.
const key = ['#file-list', 'Enter', 'Enter', true, false, false];
const key = ['#file-list', 'Enter', true, false, false];
return remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key);
}).then(function(result) {
chrome.test.assertTrue(result);
......@@ -191,7 +191,7 @@ function renameFile(appId, oldName, newName) {
'inputText', appId, [textInput, newName]);
}).then(function() {
// Send Enter key to the text input.
const key = [textInput, 'Enter', 'Enter', false, false, false];
const key = [textInput, 'Enter', false, false, false];
return remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key);
}).then(function(result) {
chrome.test.assertTrue(result);
......@@ -227,7 +227,7 @@ function testRenameFolder(path, treeItem) {
}).then(function(result) {
chrome.test.assertTrue(result);
// Press ArrowDown to select the photos folder.
const select = ['#file-list', 'ArrowDown', 'Down', false, false, false];
const select = ['#file-list', 'ArrowDown', false, false, false];
return remoteCall.callRemoteTestUtil('fakeKeyDown', appId, select);
}).then(function(result) {
chrome.test.assertTrue(result);
......@@ -236,7 +236,7 @@ function testRenameFolder(path, treeItem) {
return remoteCall.waitForElement(appId, selectedItem);
}).then(function() {
// Press Ctrl+Enter to rename the photos folder.
const key = ['#file-list', 'Enter', 'Enter', true, false, false];
const key = ['#file-list', 'Enter', true, false, false];
return remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key);
}).then(function(result) {
chrome.test.assertTrue(result);
......@@ -248,12 +248,12 @@ function testRenameFolder(path, treeItem) {
'inputText', appId, [textInput, 'bbq photos']);
}).then(function() {
// Send Enter to the list to attempt to enter the directory.
const key = ['#list-container', 'Enter', 'Enter', false, false, false];
const key = ['#list-container', 'Enter', false, false, false];
return remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key);
}).then(function(result) {
chrome.test.assertTrue(result);
// Send Enter to the text input to complete renaming.
const key = [textInput, 'Enter', 'Enter', false, false, false];
const key = [textInput, 'Enter', false, false, false];
return remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key);
}).then(function(result) {
chrome.test.assertTrue(result);
......
......@@ -77,7 +77,7 @@ function audioPlayingQuery(fileName) {
function audioTimeLeapForward(audioAppId) {
for (let i = 1; i <= 9; ++i) {
audioPlayerApp.fakeKeyDown(
audioAppId, 'body', 'ArrowRight', 'Right', false, false, false);
audioAppId, 'body', 'ArrowRight', false, false, false);
}
}
......
......@@ -30,7 +30,7 @@ function openQuickViewSteps(appId, name) {
// Press the space key.
function(result) {
chrome.test.assertTrue(!!result, 'selectFile failed');
const space = ['#file-list', ' ', ' ', false, false, false];
const space = ['#file-list', ' ', false, false, false];
remoteCall.callRemoteTestUtil('fakeKeyDown', appId, space, this.next);
},
// Check: the Quick View element should be shown.
......
......@@ -22,9 +22,7 @@ testcase.tabindexSearchBoxFocus = function() {
// Press the Ctrl-F key.
function(element) {
remoteCall.callRemoteTestUtil(
'fakeKeyDown', appId,
['body', 'f', 'U+0046', true, false, false],
this.next);
'fakeKeyDown', appId, ['body', 'f', true, false, false], this.next);
},
// Check that the search box has the focus.
function(result) {
......@@ -36,8 +34,7 @@ testcase.tabindexSearchBoxFocus = function() {
function(element) {
remoteCall.callRemoteTestUtil(
'fakeKeyDown', appId,
['#search-box cr-input', 'Escape', 'U+001B', false, false, false],
this.next);
['#search-box cr-input', 'Escape', false, false, false], this.next);
},
// Check that the file list has the focus.
function(result) {
......@@ -286,8 +283,7 @@ function tabindexFocus(dialogParams, volumeName, expectedSet, initialize,
promise = promise.then(function() {
// Closes the window by pressing Enter.
return remoteCall.callRemoteTestUtil(
'fakeKeyDown', appId, ['#file-list', 'Enter', 'Enter', false, false,
false]);
'fakeKeyDown', appId, ['#file-list', 'Enter', false, false, false]);
});
return promise;
......
......@@ -36,7 +36,7 @@ testcase.zipFileOpenDownloads = function() {
// Press the Enter key.
function(result) {
chrome.test.assertTrue(!!result, 'selectFile failed');
const key = ['#file-list', 'Enter', 'Enter', false, false, false];
const key = ['#file-list', 'Enter', false, false, false];
remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key, this.next);
},
// Check: the zip file content should be shown (unzip).
......@@ -69,7 +69,7 @@ testcase.zipFileOpenDrive = function() {
// Press the Enter key.
function(result) {
chrome.test.assertTrue(!!result, 'selectFile failed');
const key = ['#file-list', 'Enter', 'Enter', false, false, false];
const key = ['#file-list', 'Enter', false, false, false];
remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key, this.next);
},
// Check: the zip file content should be shown (unzip).
......@@ -127,7 +127,7 @@ testcase.zipFileOpenUsb = function() {
// Press the Enter key.
function(result) {
chrome.test.assertTrue(!!result, 'selectFile failed');
const key = ['#file-list', 'Enter', 'Enter', false, false, false];
const key = ['#file-list', 'Enter', false, false, false];
remoteCall.callRemoteTestUtil('fakeKeyDown', appId, key, this.next);
},
// Check: the zip file content should be shown (unzip).
......
......@@ -114,7 +114,7 @@ function openMultipleImagesAndChangeToSlideMode(testVolumeName, volumeType) {
// Press Enter key and mode should be changed to slide mode.
return gallery.callRemoteTestUtil(
'fakeKeyDown', appId,
[null /* active element */, 'Enter', 'Enter', false, false, false]);
[null /* active element */, 'Enter', false, false, false]);
}).then(function() {
// Wait until it changes to slide mode.
return gallery.waitForElement(appId, '.gallery[mode="slide"]');
......
......@@ -94,7 +94,7 @@ function cropImage(testVolumeName, volumeType) {
}).
then(function() {
return gallery.fakeKeyDown(
appId, 'body', 'Enter', 'Enter', false, false, false);
appId, 'body', 'Enter', false, false, false);
}).
then(function(ret) {
chrome.test.assertTrue(ret);
......@@ -158,8 +158,7 @@ function exposureImage(testVolumeName, volumeType) {
origMetadata = metadata;
// Push the Enter key.
return gallery.fakeKeyDown(appId, 'body', 'Enter', 'Enter', false, false,
false);
return gallery.fakeKeyDown(appId, 'body', 'Enter', false, false, false);
}).then(function() {
// Wait until the image is updated.
return repeatUntil(function() {
......@@ -209,7 +208,7 @@ function resizeImage(testVolumeName, volumeType) {
})
.then(function() {
return gallery.fakeKeyDown(
appId, 'body', 'Enter', 'Enter', false, false, false);
appId, 'body', 'Enter', false, false, false);
})
.then(function() {
return gallery.waitForSlideImage(appId, 667, 500,
......@@ -248,7 +247,7 @@ function resizeImage(testVolumeName, volumeType) {
})
.then(function() {
return gallery.fakeKeyDown(
appId, 'body', 'Enter', 'Enter', false, false, false);
appId, 'body', 'Enter', false, false, false);
})
.then(function() {
return gallery.waitForSlideImage(appId, 500, 300,
......
......@@ -96,7 +96,7 @@ function deleteAllImagesInThumbnailMode(testVolumeName, volumeType, operation) {
}).then(function() {
return gallery.callRemoteTestUtil(
'fakeKeyDown', appId,
['button.delete', 'Enter', 'Enter', false, false, false]);
['button.delete', 'Enter', false, false, false]);
}).then(function() {
// When user has pressed enter key on button, click event is
// dispatched after keydown event.
......@@ -107,8 +107,7 @@ function deleteAllImagesInThumbnailMode(testVolumeName, volumeType, operation) {
case 'delete-key':
// Press delete key.
return gallery.callRemoteTestUtil(
'fakeKeyDown', appId,
['body', 'Delete', 'U+007F' /* Delete */, false, false, false]);
'fakeKeyDown', appId, ['body', 'Delete', false, false, false]);
break;
}
}).then(function(result) {
......@@ -198,8 +197,7 @@ function selectMultipleImagesWithShiftKey(testVolumeName, volumeType) {
// Press Right key with shift.
return gallery.fakeKeyDown(
appId, '.thumbnail-view', 'ArrowRight', 'Right', false,
true /* Shift */, false);
appId, '.thumbnail-view', 'ArrowRight', false, true /* Shift */, false);
}).then(function() {
// Confirm 2 images are selected: [1][2] 3
return gallery.callRemoteTestUtil('queryAllElements', appId,
......@@ -211,8 +209,7 @@ function selectMultipleImagesWithShiftKey(testVolumeName, volumeType) {
// Press Right key with shift.
return gallery.fakeKeyDown(
appId, '.thumbnail-view', 'ArrowRight', 'Right', false,
true /* Shift */, false);
appId, '.thumbnail-view', 'ArrowRight', false, true /* Shift */, false);
}).then(function() {
// Confirm 3 images are selected: [1][2][3]
return gallery.callRemoteTestUtil('queryAllElements', appId,
......@@ -226,8 +223,7 @@ function selectMultipleImagesWithShiftKey(testVolumeName, volumeType) {
// Press Left key with shift.
return gallery.fakeKeyDown(
appId, '.thumbnail-view', 'ArrowLeft', 'Left', false,
true /* Shift */, false);
appId, '.thumbnail-view', 'ArrowLeft', false, true /* Shift */, false);
}).then(function() {
// Confirm 2 images are selected: [1][2] 3
return gallery.callRemoteTestUtil('queryAllElements', appId,
......@@ -239,8 +235,7 @@ function selectMultipleImagesWithShiftKey(testVolumeName, volumeType) {
// Press Right key without shift.
return gallery.fakeKeyDown(
appId, '.thumbnail-view', 'ArrowRight', 'Right', false,
false, false);
appId, '.thumbnail-view', 'ArrowRight', false, false, false);
}).then(function() {
// Confirm only the last image is selected: 1 2 [3]
return gallery.callRemoteTestUtil('queryAllElements', appId,
......@@ -285,8 +280,7 @@ function selectAllImagesAfterImageDeletionOnDownloads(
}).then(function() {
// Press Ctrl+A to select all images.
return gallery.fakeKeyDown(appId, '.thumbnail-view',
'a', 'U+0041' /* A */, true /* Ctrl*/, false /* Shift */,
false /* Alt */);
'a', true /* Ctrl*/, false /* Shift */, false /* Alt */);
}).then(function() {
// Confirm that 2 images are selected.
return gallery.callRemoteTestUtil('queryAllElements', appId,
......
......@@ -259,7 +259,6 @@ RemoteCall.prototype.waitForElementLost = function(windowId, query) {
* @param {string} windowId Window ID.
* @param {string} query Query for the target element.
* @param {string} key DOM UI Events Key value.
* @param {string} keyIdentifer Key identifier.
* @param {boolean} ctrlKey Control key flag.
* @param {boolean} shiftKey Shift key flag.
* @param {boolean} altKey Alt key flag.
......@@ -267,10 +266,9 @@ RemoteCall.prototype.waitForElementLost = function(windowId, query) {
* result.
*/
RemoteCall.prototype.fakeKeyDown =
function(windowId, query, key, keyIdentifer, ctrlKey, shiftKey, altKey) {
function(windowId, query, key, ctrlKey, shiftKey, altKey) {
var resultPromise = this.callRemoteTestUtil(
'fakeKeyDown', windowId,
[query, key, keyIdentifer, ctrlKey, shiftKey, altKey]);
'fakeKeyDown', windowId, [query, key, ctrlKey, shiftKey, altKey]);
return resultPromise.then(function(result) {
if (result)
return true;
......@@ -422,9 +420,8 @@ RemoteCallFilesApp.prototype.waitUntilTaskExecutes = function(
*/
RemoteCallFilesApp.prototype.checkNextTabFocus =
function(windowId, elementId) {
return remoteCall.callRemoteTestUtil('fakeKeyDown',
windowId,
['body', 'Tab', 'U+0009', false]).then(
return remoteCall.callRemoteTestUtil(
'fakeKeyDown', windowId, ['body', 'Tab', false, false, false]).then(
function(result) {
chrome.test.assertTrue(result);
return remoteCall.callRemoteTestUtil('getActiveElement',
......
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