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

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

Issue 2478583005: Browser tests for starting a drag-and-drop out of an OOPIF. (Closed)
Patch Set: Rebasing... Created 4 years, 1 month 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
(Empty)
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
3 // found in the LICENSE file.
4
5 /* Reports an event to DragAndDropBrowserTest and DOMDragEventWaiter */
6 window.reportDragAndDropEvent = function(ev) {
7 function safe(f) {
8 try {
9 return f();
10 } catch(err) {
11 return "exception: " + err.message;
12 }
13 }
14
15 console.log("got event: " + ev.type);
16
17 if (window.domAutomationController) {
18 window.domAutomationController.setAutomationId(0);
19 window.domAutomationController.send({
20 drop_effect: safe(function() { return ev.dataTransfer.dropEffect; }),
21 effect_allowed: safe(function() {
22 return ev.dataTransfer.effectAllowed;
23 }),
24 event_type: ev.type,
25 file_names: safe(function() {
26 return Array
27 .from(ev.dataTransfer.files)
28 .map(function(file) { return file.name; })
29 .sort().join();
30 }),
31 mime_types: safe(function() {
32 return Array.from(ev.dataTransfer.types).sort().join();
33 }),
34 window_name: window.name
35 });
36 }
37 }
OLDNEW
« no previous file with comments | « content/test/data/drag_and_drop/drop_target.html ('k') | content/test/data/drag_and_drop/image_source.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698