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

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: Fix to finish renaming domExpectedActivity2 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
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/activity_log_private/test/test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2a2524dd12ff9e5feb00158c1ae03b2d2bc27c9b 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,27 @@ function executeDOMChangesOnTabUpdated() {
'request.send(); ' +
'document.write("sent an XHR");';
+ // This function is used as a handler for hooking mouse and keyboard events.
+ 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'];
+
+ // Access to each hook can be monitored for Element, Document, and Window.
+ 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' &&
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/activity_log_private/test/test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698