Assert key and code in keyup input event spec
This commit is contained in:
parent
424afd3faf
commit
e4b0577cb0
3 changed files with 3 additions and 2 deletions
|
@ -15,6 +15,7 @@ namespace atom {
|
|||
// pressed.
|
||||
ui::KeyboardCode KeyboardCodeFromStr(const std::string& str, bool* shifted);
|
||||
|
||||
// Ported from ui/events/blink/blink_event_util.h
|
||||
int WebEventModifiersToEventFlags(int modifiers);
|
||||
|
||||
} // namespace atom
|
||||
|
|
2
spec/fixtures/pages/onkeyup.html
vendored
2
spec/fixtures/pages/onkeyup.html
vendored
|
@ -2,7 +2,7 @@
|
|||
<body>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
document.onkeyup = function(e) {
|
||||
require('electron').ipcRenderer.sendToHost('keyup', e.keyCode, e.shiftKey, e.ctrlKey);
|
||||
require('electron').ipcRenderer.sendToHost('keyup', e.key, e.code, e.keyCode, e.shiftKey, e.ctrlKey);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -776,7 +776,7 @@ describe('<webview> tag', function () {
|
|||
it('can send keyboard event', function (done) {
|
||||
webview.addEventListener('ipc-message', function (e) {
|
||||
assert.equal(e.channel, 'keyup')
|
||||
assert.deepEqual(e.args, [67, true, false])
|
||||
assert.deepEqual(e.args, ['C', 'KeyC', 67, true, false])
|
||||
done()
|
||||
})
|
||||
webview.addEventListener('dom-ready', function () {
|
||||
|
|
Loading…
Reference in a new issue