summaryrefslogtreecommitdiffstats
path: root/remoting/tools
diff options
context:
space:
mode:
authorjamiewalch <jamiewalch@chromium.org>2015-02-09 15:27:10 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-09 23:28:21 +0000
commit7a9ac6310a6ce95821213461911d7650654215dc (patch)
tree9732dcae299cca33fbeedaf020e0ce645873f58f /remoting/tools
parentcfd26c4af6ab5bad930578a43f25ff0dafeeffb5 (diff)
downloadchromium_src-7a9ac6310a6ce95821213461911d7650654215dc.zip
chromium_src-7a9ac6310a6ce95821213461911d7650654215dc.tar.gz
chromium_src-7a9ac6310a6ce95821213461911d7650654215dc.tar.bz2
Remove the JS key log summary, since it's of limited value without the "code" field. Also includes misc fixes for release.
* Change the title, since we're no longer just JS. * Add a description for CWS. * Update version number. Review URL: https://codereview.chromium.org/910483002 Cr-Commit-Position: refs/heads/master@{#315427}
Diffstat (limited to 'remoting/tools')
-rw-r--r--remoting/tools/javascript_key_tester/chord_tracker.js37
-rw-r--r--remoting/tools/javascript_key_tester/event_listeners.js15
-rw-r--r--remoting/tools/javascript_key_tester/keyboard_map.js264
-rw-r--r--remoting/tools/javascript_key_tester/main.css6
-rw-r--r--remoting/tools/javascript_key_tester/main.html10
-rw-r--r--remoting/tools/javascript_key_tester/main.js4
-rw-r--r--remoting/tools/javascript_key_tester/manifest.json5
7 files changed, 19 insertions, 322 deletions
diff --git a/remoting/tools/javascript_key_tester/chord_tracker.js b/remoting/tools/javascript_key_tester/chord_tracker.js
index ca1cdb4..9afc26a 100644
--- a/remoting/tools/javascript_key_tester/chord_tracker.js
+++ b/remoting/tools/javascript_key_tester/chord_tracker.js
@@ -17,30 +17,26 @@ var ChordTracker = function(parentDiv) {
};
/**
- * @param {number|string} keyId Either a Javascript key-code, or a PNaCl "code"
- * string.
+ * @param {string} code The PNaCl "code" string.
* @param {string} title
* @return {void}
*/
-ChordTracker.prototype.addKeyUpEvent = function(keyId, title) {
- var text = this.keyName_(keyId);
- var span = this.addSpanElement_('key-up', text, title);
- delete this.pressedKeys_[keyId];
+ChordTracker.prototype.addKeyUpEvent = function(code, title) {
+ var span = this.addSpanElement_('key-up', code, title);
+ delete this.pressedKeys_[code];
if (!this.keysPressed_()) {
this.end_();
}
};
/**
- * @param {number|string} keyId Either a Javascript key-code, or a PNaCl "code"
- * string.
+ * @param {string} code The PNaCl "code" string.
* @param {string} title
* @return {void}
*/
-ChordTracker.prototype.addKeyDownEvent = function(keyId, title) {
- var text = this.keyName_(keyId);
- var span = this.addSpanElement_('key-down', text, title);
- this.pressedKeys_[keyId] = span;
+ChordTracker.prototype.addKeyDownEvent = function(code, title) {
+ var span = this.addSpanElement_('key-down', code, title);
+ this.pressedKeys_[code] = span;
};
/**
@@ -118,20 +114,3 @@ ChordTracker.prototype.keysPressed_ = function() {
}
return false;
};
-
-/**
- * @param {number|string} keyId Either a Javascript key-code, or a PNaCl "code"
- * string.
- * @return {string} A human-readable representation of the key.
- * @private
- */
-ChordTracker.prototype.keyName_ = function(keyId) {
- if (typeof keyId == 'string') {
- return keyId;
- }
- var result = keyboardMap[keyId];
- if (!result) {
- result = '<' + keyId + '>';
- }
- return result;
-};
diff --git a/remoting/tools/javascript_key_tester/event_listeners.js b/remoting/tools/javascript_key_tester/event_listeners.js
index a70d40c..96bd12a 100644
--- a/remoting/tools/javascript_key_tester/event_listeners.js
+++ b/remoting/tools/javascript_key_tester/event_listeners.js
@@ -19,15 +19,13 @@ var PNaClEvent = function() {
/**
- * @param {HTMLElement} jsLog
* @param {HTMLElement} pnaclLog
* @param {HTMLElement} textLog
* @param {HTMLElement} pnaclPlugin
* @param {HTMLElement} pnaclListener
* @constructor
*/
-var EventListeners = function(jsLog, pnaclLog, textLog,
- pnaclPlugin, pnaclListener) {
+var EventListeners = function(pnaclLog, textLog, pnaclPlugin, pnaclListener) {
this.pnaclPlugin_ = pnaclPlugin;
this.pnaclListener_ = pnaclListener;
this.textLog_ = textLog;
@@ -39,7 +37,6 @@ var EventListeners = function(jsLog, pnaclLog, textLog,
this.onPluginBlurHandler_ = this.onPluginBlur_.bind(this);
this.onWindowBlurHandler_ = this.onWindowBlur_.bind(this);
- this.jsChordTracker_ = new ChordTracker(jsLog);
this.pnaclChordTracker_ = new ChordTracker(pnaclLog);
this.startTime_ = new Date();
@@ -78,8 +75,6 @@ EventListeners.prototype.deactivate = function() {
*/
EventListeners.prototype.onKeyDown_ = function(event) {
this.appendToTextLog_(this.jsonifyJavascriptKeyEvent_(event, 'keydown'));
- this.jsChordTracker_.addKeyDownEvent(
- event.keyCode, this.jsonifyJavascriptKeyEvent_(event, 'keydown', 2));
};
/**
@@ -88,8 +83,6 @@ EventListeners.prototype.onKeyDown_ = function(event) {
*/
EventListeners.prototype.onKeyUp_ = function(event) {
this.appendToTextLog_(this.jsonifyJavascriptKeyEvent_(event, 'keyup'));
- this.jsChordTracker_.addKeyUpEvent(
- event.keyCode, this.jsonifyJavascriptKeyEvent_(event, 'keyup', 2));
}
/**
@@ -98,9 +91,6 @@ EventListeners.prototype.onKeyUp_ = function(event) {
*/
EventListeners.prototype.onKeyPress_ = function(event) {
this.appendToTextLog_(this.jsonifyJavascriptKeyEvent_(event, 'keypress'));
- this.jsChordTracker_.addCharEvent(
- String.fromCharCode(event.keyCode),
- this.jsonifyJavascriptKeyEvent_(event, 'keypress', 2));
}
/**
@@ -134,7 +124,6 @@ EventListeners.prototype.onPluginBlur_ = function() {
* @return {void}
*/
EventListeners.prototype.onWindowBlur_ = function() {
- this.jsChordTracker_.releaseAllKeys();
this.pnaclChordTracker_.releaseAllKeys();
};
@@ -160,7 +149,7 @@ EventListeners.prototype.jsonifyJavascriptKeyEvent_ =
return "JavaScript '" + eventName + "' event = " + JSON.stringify(
event,
['type', 'alt', 'shift', 'control', 'meta', 'charCode', 'keyCode',
- 'keyIdentifier', 'repeat'],
+ 'keyIdentifier', 'repeat', 'code'],
opt_space);
};
diff --git a/remoting/tools/javascript_key_tester/keyboard_map.js b/remoting/tools/javascript_key_tester/keyboard_map.js
deleted file mode 100644
index 7ca1366..0000000
--- a/remoting/tools/javascript_key_tester/keyboard_map.js
+++ /dev/null
@@ -1,264 +0,0 @@
-/* Copyright (c) 2014 The Chromium Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/** @type {Array.<string>} */
-var keyboardMap = [
- '',
- '',
- '',
- 'Cancel',
- '',
- '',
- 'Help',
- '',
- 'Backspace',
- 'Tab',
- '',
- '',
- 'Clear',
- 'Enter',
- 'Return',
- '',
- 'Shift',
- 'Control',
- 'Alt',
- 'Pause',
- 'CapsLock',
- 'Kana',
- 'Eisu',
- 'Junja',
- 'Final',
- 'Hanja',
- '',
- 'Escape',
- 'Convert',
- 'NonConvert',
- 'Accept',
- 'ModeChange',
- 'Space',
- 'PageUp',
- 'PageDown',
- 'End',
- 'Home',
- 'Left',
- 'Up',
- 'Right',
- 'Down',
- 'Selse',
- 'Print',
- 'Execute',
- 'PrtScn',
- 'Insert',
- 'Delete',
- '',
- 'Digit0',
- 'Digit1',
- 'Digit2',
- 'Digit3',
- 'Digit4',
- 'Digit5',
- 'Digit6',
- 'Digit7',
- 'Digit8',
- 'Digit9',
- 'Colon',
- 'Semicolon',
- 'LessThan',
- 'Equals',
- 'GreaterThen',
- 'QuestionMark',
- 'At',
- 'KeyA',
- 'KeyB',
- 'KeyC',
- 'KeyD',
- 'KeyE',
- 'KeyF',
- 'KeyG',
- 'KeyH',
- 'KeyI',
- 'KeyJ',
- 'KeyK',
- 'KeyL',
- 'KeyM',
- 'KeyN',
- 'KeyO',
- 'KeyP',
- 'KeyQ',
- 'KeyR',
- 'KeyS',
- 'KeyT',
- 'KeyU',
- 'KeyV',
- 'KeyW',
- 'KeyX',
- 'KeyY',
- 'KeyZ',
- 'OSLeft',
- 'OSRight',
- 'ContextMenu',
- '',
- 'Sleep',
- 'Numpad0',
- 'Numpad1',
- 'Numpad2',
- 'Numpad3',
- 'Numpad4',
- 'Numpad5',
- 'Numpad6',
- 'Numpad7',
- 'Numpad8',
- 'Numpad9',
- 'NumpadMultiply',
- 'NumpadAdd',
- 'Separator',
- 'NumpadSubtract',
- 'NumpadDecimal',
- 'NumpadDivide',
- 'F1',
- 'F2',
- 'F3',
- 'F4',
- 'F5',
- 'F6',
- 'F7',
- 'F8',
- 'F9',
- 'F10',
- 'F11',
- 'F12',
- 'F13',
- 'F14',
- 'F15',
- 'F16',
- 'F17',
- 'F18',
- 'F19',
- 'F20',
- 'F21',
- 'F22',
- 'F23',
- 'F24',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- 'NumLock',
- 'ScrollLock',
- 'WIN_OEM_FJ_JISHO',
- 'WIN_OEM_FJ_MASSHOU',
- 'WIN_OEM_FJ_TOUROKU',
- 'WIN_OEM_FJ_LOYA',
- 'WIN_OEM_FJ_ROYA',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- 'Circumflex',
- 'Exclamation',
- 'DoubleQuote',
- 'Hash',
- 'Dollar',
- 'Percent',
- 'Ampersand',
- 'Underscore',
- 'OpenParenthesis',
- 'CloseParenthesis',
- 'Asterisk',
- 'Plus',
- 'Pipe',
- 'HypenMinus',
- 'OpenBrace',
- 'CloseBrace',
- 'Tilde',
- '',
- '',
- '',
- '',
- 'VolumeMute',
- 'VolumeDown',
- 'VolumeUp',
- '',
- '',
- '',
- 'Equal',
- 'Comma',
- 'Minus',
- 'Period',
- 'Slash',
- 'Backquote',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- 'OpenBracket',
- 'Backslash',
- 'CloseBracket',
- 'Quote',
- '',
- 'Meta',
- 'AltGr',
- '',
- 'WIN_ICO_HELP',
- 'WIN_ICO_00',
- '',
- 'WIN_ICO_CLEAR',
- '',
- '',
- 'WIN_OEM_RESET',
- 'WIN_OEM_JUMP',
- 'WIN_OEM_PA1',
- 'WIN_OEM_PA2',
- 'WIN_OEM_PA3',
- 'WIN_OEM_WSCTRL',
- 'WIN_OEM_CUSEL',
- 'WIN_OEM_ATTN',
- 'WIN_OEM_FINISH',
- 'WIN_OEM_COPY',
- 'WIN_OEM_AUTO',
- 'WIN_OEM_ENLW',
- 'WIN_OEM_BACKTAB',
- 'ATTN',
- 'CRSEL',
- 'EXSEL',
- 'EREOF',
- 'PLAY',
- 'ZOOM',
- '',
- 'PA1',
- 'WIN_OEM_CLEAR',
- ''
-];
diff --git a/remoting/tools/javascript_key_tester/main.css b/remoting/tools/javascript_key_tester/main.css
index 0c6f4e5..46945e0 100644
--- a/remoting/tools/javascript_key_tester/main.css
+++ b/remoting/tools/javascript_key_tester/main.css
@@ -13,10 +13,8 @@ html {
}
.summary-log-container {
- width: 50%;
height: 100%;
overflow-y: auto;
- float: left;
}
#text-log-container {
@@ -35,6 +33,10 @@ html {
padding: 8px;
}
+#pnacl-listener {
+ height: 0;
+}
+
.selectable {
-webkit-user-select: text;
cursor: text;
diff --git a/remoting/tools/javascript_key_tester/main.html b/remoting/tools/javascript_key_tester/main.html
index dfdf634..3e47c2a 100644
--- a/remoting/tools/javascript_key_tester/main.html
+++ b/remoting/tools/javascript_key_tester/main.html
@@ -25,15 +25,7 @@ found in the LICENSE file.
src="remoting_key_tester.nmf" type="application/x-pnacl" />
</div>
<div class="logs">
- <div class="summary-log-container">
- Summary of JavaScript logs:
- <div id="javascript-log">
- </div>
- </div>
- <div class="summary-log-container">
- Summary of PNaCl logs:
- <div id="pnacl-log">
- </div>
+ <div id="pnacl-log" class="summary-log-container">
</div>
<div id="text-log-container" hidden>
<div>
diff --git a/remoting/tools/javascript_key_tester/main.js b/remoting/tools/javascript_key_tester/main.js
index 1dc8bbe..45387ac 100644
--- a/remoting/tools/javascript_key_tester/main.js
+++ b/remoting/tools/javascript_key_tester/main.js
@@ -4,21 +4,19 @@
*/
function onLoad() {
- var jsLog = document.getElementById('javascript-log');
var pnaclLog = document.getElementById('pnacl-log');
var pnaclPlugin = document.getElementById('pnacl-plugin');
var pnaclListener = document.getElementById('pnacl-listener');
var textLog = document.getElementById('text-log');
var textLogContainer = document.getElementById('text-log-container');
- var eventListeners = new EventListeners(jsLog, pnaclLog, textLog,
+ var eventListeners = new EventListeners(pnaclLog, textLog,
pnaclPlugin, pnaclListener);
eventListeners.activate();
document.getElementById('clear-log').addEventListener(
'click',
function() {
- jsLog.innerText = '';
pnaclLog.innerText = '';
textLog.innerText = '';
},
diff --git a/remoting/tools/javascript_key_tester/manifest.json b/remoting/tools/javascript_key_tester/manifest.json
index 625a472..fd3c7c1 100644
--- a/remoting/tools/javascript_key_tester/manifest.json
+++ b/remoting/tools/javascript_key_tester/manifest.json
@@ -1,6 +1,7 @@
{
- "name": "Javascript key event tester",
- "version": "1.1",
+ "name": "Chrome Key Event Tester",
+ "description": "Test press, release and character events for JavaScript and PPAPI.",
+ "version": "1.2",
"manifest_version": 2,
"icons": {
"128": "icon_128.png"