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

Unified Diff: chrome/browser/ui/views/drag_and_drop_interactive_uitest.h

Issue 2622733002: Mac Support for drag-and-drop tests that start dragging via mouse simulation.
Patch Set: . Created 3 years, 11 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/browser/ui/views/drag_and_drop_interactive_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/drag_and_drop_interactive_uitest.h
diff --git a/chrome/browser/ui/views/drag_and_drop_interactive_uitest.h b/chrome/browser/ui/views/drag_and_drop_interactive_uitest.h
new file mode 100644
index 0000000000000000000000000000000000000000..f16df0d1264369bef4178c4f153080a955b36667
--- /dev/null
+++ b/chrome/browser/ui/views/drag_and_drop_interactive_uitest.h
@@ -0,0 +1,48 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_VIEWS_DRAG_AND_DROP_INTERACTIVE_UITEST_H_
+#define CHROME_BROWSER_UI_VIEWS_DRAG_AND_DROP_INTERACTIVE_UITEST_H_
+
+#include <memory>
+#include <string>
+
+#include "base/macros.h"
+
+namespace content {
+class WebContents;
+} // namespace content
+
+namespace gfx {
+class Point;
+} // namespace gfx
+
+// Test helper for simulating drag and drop happening in WebContents.
+class ExternalDragEnterSimulator {
+ public:
+ static std::unique_ptr<ExternalDragEnterSimulator> Create(
+ content::WebContents* web_contents);
+
+ virtual ~ExternalDragEnterSimulator() {}
+
+ // Simulates notification that |text| was dragged from outside of the browser,
+ // into the specified |location| inside |web_contents|.
+ // |location| is relative to |web_contents|.
+ // Returns true upon success.
+ virtual bool SimulateDragEnter(const gfx::Point& location,
+ const std::string& text) = 0;
+
+ // Simulates dropping of the drag-and-dropped item.
+ // SimulateDragEnter needs to be called first.
+ // Returns true upon success.
+ virtual bool SimulateDrop(const gfx::Point& location);
+
+ protected:
+ ExternalDragEnterSimulator() = default;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ExternalDragEnterSimulator);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_DRAG_AND_DROP_INTERACTIVE_UITEST_H_
« no previous file with comments | « no previous file | chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698