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

Side by Side Diff: chrome/test/data/drag_and_drop/event_monitoring.js

Issue 2503453003: Remove all calls to domAutomationController.setAutomationId.
Patch Set: Fix nacl_browsertest_util.cc Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /* Reports an event to DragAndDropBrowserTest and DOMDragEventWaiter */ 5 /* Reports an event to DragAndDropBrowserTest and DOMDragEventWaiter */
6 window.reportDragAndDropEvent = function(ev) { 6 window.reportDragAndDropEvent = function(ev) {
7 function safe(f) { 7 function safe(f) {
8 try { 8 try {
9 return f(); 9 return f();
10 } catch(err) { 10 } catch(err) {
11 return "Got exception: " + err.message; 11 return "Got exception: " + err.message;
12 } 12 }
13 } 13 }
14 14
15 var msg = "Got a " + ev.type + " event from the " + window.name + " frame."; 15 var msg = "Got a " + ev.type + " event from the " + window.name + " frame.";
16 console.log(msg); 16 console.log(msg);
17 17
18 if (window.domAutomationController) { 18 if (window.domAutomationController) {
19 window.domAutomationController.setAutomationId(0);
20 window.domAutomationController.send({ 19 window.domAutomationController.send({
21 client_position: safe(function() { 20 client_position: safe(function() {
22 return "(" + ev.clientX + ", " + ev.clientY + ")"; 21 return "(" + ev.clientX + ", " + ev.clientY + ")";
23 }), 22 }),
24 drop_effect: safe(function() { return ev.dataTransfer.dropEffect; }), 23 drop_effect: safe(function() { return ev.dataTransfer.dropEffect; }),
25 effect_allowed: safe(function() { 24 effect_allowed: safe(function() {
26 return ev.dataTransfer.effectAllowed; 25 return ev.dataTransfer.effectAllowed;
27 }), 26 }),
28 event_type: ev.type, 27 event_type: ev.type,
29 file_names: safe(function() { 28 file_names: safe(function() {
30 return Array 29 return Array
31 .from(ev.dataTransfer.files) 30 .from(ev.dataTransfer.files)
32 .map(function(file) { return file.name; }) 31 .map(function(file) { return file.name; })
33 .sort().join(); 32 .sort().join();
34 }), 33 }),
35 mime_types: safe(function() { 34 mime_types: safe(function() {
36 return Array.from(ev.dataTransfer.types).sort().join(); 35 return Array.from(ev.dataTransfer.types).sort().join();
37 }), 36 }),
38 page_position: safe(function() { 37 page_position: safe(function() {
39 return "(" + ev.pageX + ", " + ev.pageY + ")"; 38 return "(" + ev.pageX + ", " + ev.pageY + ")";
40 }), 39 }),
41 window_name: window.name 40 window_name: window.name
42 }); 41 });
43 } 42 }
44 } 43 }
OLDNEW
« no previous file with comments | « chrome/test/data/chrome_extension_resource.html ('k') | chrome/test/data/extensions/test_file_with_ctrl-d_keybinding.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698