Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5437)

Unified Diff: chrome/test/data/extensions/api_test/activity_log_private/friend/reply.js

Issue 19540019: Tests for changes to Blink in Issues 19697008. This adds new javascript to the (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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' &&

Powered by Google App Engine
This is Rietveld 408576698