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

Unified Diff: third_party/WebKit/Source/web/tests/SelectionTestBase.h

Issue 1774123006: Implement link selection on alt+mouse drag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove static and rename function. Created 4 years, 9 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
Index: third_party/WebKit/Source/web/tests/SelectionTestBase.h
diff --git a/third_party/WebKit/Source/web/tests/SelectionTestBase.h b/third_party/WebKit/Source/web/tests/SelectionTestBase.h
new file mode 100644
index 0000000000000000000000000000000000000000..a3c5ff0543dbc84eb43d577ccd645ee358e15d30
--- /dev/null
+++ b/third_party/WebKit/Source/web/tests/SelectionTestBase.h
@@ -0,0 +1,42 @@
+// Copyright (c) 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 SelectionTestBase_h
+#define SelectionTestBase_h
+
+#include "web/WebLocalFrameImpl.h"
+#include "web/tests/FrameTestHelpers.h"
+
+#include <gtest/gtest.h>
tkent 2016/03/25 03:33:03 Don't use <> for gtest.h.
+#include <string>
+
+namespace blink {
+class IntPoint;
+class WebViewImpl;
+class WebLocalFrameImpl;
+
+class SelectionTestBase : public ::testing::Test {
+protected:
+ enum DragFlag {
+ SendDownEvent = 1,
+ SendUpEvent = 1 << 1
+ };
+ using DragFlags = unsigned;
+
+ void emulateMouseDrag(const IntPoint& downPoint, const IntPoint& upPoint, int modifiers,
+ DragFlags = SendDownEvent | SendUpEvent);
+
+ void emulateMouseClick(const IntPoint& clickPoint, WebMouseEvent::Button, int modifiers, int count = 1);
+ void emulateMouseDown(const IntPoint& clickPoint, WebMouseEvent::Button, int modifiers, int count = 1);
+
+ std::string getSelectionText();
+
+ FrameTestHelpers::WebViewHelper m_helper;
+ WebViewImpl* m_webView = nullptr;
+ RawPtrWillBePersistent<WebLocalFrameImpl> m_mainFrame = nullptr;
+};
+
+} // namespace blink
+
+#endif // SelectionTestBase_h

Powered by Google App Engine
This is Rietveld 408576698