| 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_
|
|
|