Chromium Code Reviews| Index: chrome/test/data/extensions/api_test/activity_log_private/friend/reply.js |
| diff --git a/chrome/test/data/extensions/api_test/activity_log_private/friend/reply.js b/chrome/test/data/extensions/api_test/activity_log_private/friend/reply.js |
| index 0c843ba66424bbf16524843e1790dd1445a08ed7..1587a852bb7e7fb6999454107951a98121d20c8b 100644 |
| --- a/chrome/test/data/extensions/api_test/activity_log_private/friend/reply.js |
| +++ b/chrome/test/data/extensions/api_test/activity_log_private/friend/reply.js |
| @@ -324,6 +324,26 @@ function executeDOMChangesOnTabUpdated() { |
| 'request.send(); ' + |
| 'document.write("sent an XHR");'; |
| + // tests for hooking keyboard and mouse handlers |
|
Matt Perry
2013/07/22 18:07:05
Use full sentences for comments.
|
| + code += 'function handlerHook(event) { };'; |
| + |
| + hookNames = ['onclick', 'ondblclick', 'ondrag', 'ondragend', 'ondragenter', |
| + 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'oninput', |
| + 'onkeydown', 'onkeypress', 'onkeyup', 'onmousedown', |
| + 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', |
| + 'onmouseover', 'onmouseup', 'onmousewheel']; |
| + |
| + for (var i = 0; i < hookNames.length; i++) { |
| + // handler on Element |
| + code += 'document.body.' + hookNames[i] + ' = handlerHook;'; |
| + |
| + // handler on a Document |
| + code += 'document.' + hookNames[i] + ' = handlerHook;'; |
| + |
| + // handler on a Window |
| + code += 'window.' + hookNames[i] + ' = handlerHook;'; |
| + } |
| + |
| chrome.tabs.onUpdated.addListener( |
| function callback(tabId, changeInfo, tab) { |
| if (changeInfo['status'] === 'complete' && |