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

Unified Diff: chrome/test/data/extensions/api_test/activity_log_private/test/test.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 | « chrome/test/data/extensions/api_test/activity_log_private/friend/reply.js ('k') | no next file » | 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/test/test.js
diff --git a/chrome/test/data/extensions/api_test/activity_log_private/test/test.js b/chrome/test/data/extensions/api_test/activity_log_private/test/test.js
index b313f5d247d9356eab3dfa23ec16e3408bd4b35c..f7723b951b166f04e428a9967dfb523058405661 100644
--- a/chrome/test/data/extensions/api_test/activity_log_private/test/test.js
+++ b/chrome/test/data/extensions/api_test/activity_log_private/test/test.js
@@ -204,12 +204,9 @@ testCases.push({
'tabs.remove'
]
});
-testCases.push({
- func: function triggerDOMChangesOnTabsUpdated() {
- chrome.runtime.sendMessage('pknkgggnfecklokoggaggchhaebkajji',
- 'dom_tab_updated', function response() { });
- },
- expected_activity: [
+
+
+domExpectedActivity = [
'tabs.onUpdated',
'tabs.onUpdated',
'tabs.executeScript',
@@ -263,12 +260,39 @@ testCases.push({
// XHR from content script.
'XMLHttpRequest.open',
'XMLHttpRequest.setRequestHeader',
- 'HTMLDocument.write',
- // Close the tab.
- 'tabs.remove'
- ]
+ 'HTMLDocument.write'
+];
+
+// add the hook activity
+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++) {
+ domExpectedActivity.push('Element.' + hookNames[i]);
+ domExpectedActivity.push('Document.' + hookNames[i]);
+ domExpectedActivity.push('Window.' + hookNames[i]);
+}
+
+// Close the tab.
+domExpectedActivity.push('tabs.remove');
+
+testCases.push({
+ func: function triggerDOMChangesOnTabsUpdated() {
+ chrome.runtime.sendMessage('pknkgggnfecklokoggaggchhaebkajji',
+ 'dom_tab_updated', function response() { });
+ },
+ expected_activity: domExpectedActivity
});
+// copy the array for the next test so we can modify it
+var domExpectedActivityIncognito = domExpectedActivity.slice(0);
+
+// put windows.create at the front of the expected values for the next test
+domExpectedActivityIncognito.unshift('windows.create');
+
testCases.push({
func: function triggerDOMChangesOnTabsUpdated() {
chrome.runtime.sendMessage('pknkgggnfecklokoggaggchhaebkajji',
@@ -278,65 +302,7 @@ testCases.push({
// TODO(mvrable): set this back to true to test the URL values when incognito
// cleaning is working correctly for DOM logging (crbug.com/253368).
is_incognito: false,
- expected_activity: [
- 'windows.create',
- 'tabs.onUpdated',
- 'tabs.onUpdated',
- 'tabs.executeScript',
- // Location access
- 'Window.location',
- 'Document.location',
- 'Window.location',
- 'Location.assign',
- 'Location.replace',
- // Dom mutations
- 'Document.createElement',
- 'Document.createElement',
- 'Document.location',
- 'Node.appendChild',
- 'Document.location',
- 'Document.location',
- 'Node.insertBefore',
- 'Document.location',
- 'Document.location',
- 'Node.replaceChild',
- //'Document.location',
- 'HTMLDocument.write',
- 'HTMLDocument.writeln',
- 'HTMLElement.innerHTML',
- // Navigator access
- 'Window.navigator',
- 'Geolocation.getCurrentPosition',
- 'Geolocation.watchPosition',
- // Web store access - session storage
- 'Window.sessionStorage',
- 'Storage.setItem',
- 'Storage.getItem',
- 'Storage.removeItem',
- 'Storage.clear',
- // Web store access - local storage
- 'Window.localStorage',
- 'Storage.setItem',
- 'Storage.getItem',
- 'Storage.removeItem',
- 'Storage.clear',
- // Notification access
- 'Window.webkitNotifications',
- 'NotificationCenter.createNotification',
- // Cache access
- 'Window.applicationCache',
- // Web database access
- 'Window.openDatabase',
- // Canvas access
- 'Document.createElement',
- 'HTMLCanvasElement.getContext',
- // XHR from content script.
- 'XMLHttpRequest.open',
- 'XMLHttpRequest.setRequestHeader',
- 'HTMLDocument.write',
- // Close the tab.
- 'tabs.remove'
- ]
+ expected_activity: domExpectedActivityIncognito
});
// Listener to check the expected logging is done in the test cases.
« no previous file with comments | « chrome/test/data/extensions/api_test/activity_log_private/friend/reply.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698