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

Unified Diff: third_party/WebKit/Source/web/tests/TouchActionTest.cpp

Issue 2863693003: Unify TouchAction classes (Closed)
Patch Set: add cstdlib Created 3 years, 7 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 | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/TouchActionTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/TouchActionTest.cpp b/third_party/WebKit/Source/web/tests/TouchActionTest.cpp
index 7f83f429a076211889e861c7fb197ae176845d50..bde7fcf6a0d82e269c3a795a8e8191d248e9303d 100644
--- a/third_party/WebKit/Source/web/tests/TouchActionTest.cpp
+++ b/third_party/WebKit/Source/web/tests/TouchActionTest.cpp
@@ -42,6 +42,7 @@
#include "core/layout/HitTestResult.h"
#include "core/layout/LayoutTreeAsText.h"
#include "core/layout/api/LayoutViewItem.h"
+#include "platform/graphics/TouchAction.h"
#include "platform/testing/URLTestHelpers.h"
#include "platform/testing/UnitTestHelpers.h"
#include "public/platform/Platform.h"
@@ -51,7 +52,6 @@
#include "public/web/WebDocument.h"
#include "public/web/WebFrame.h"
#include "public/web/WebHitTestResult.h"
-#include "public/web/WebTouchAction.h"
#include "public/web/WebView.h"
#include "public/web/WebViewClient.h"
#include "public/web/WebWidgetClient.h"
@@ -66,10 +66,10 @@ class TouchActionTrackingWebWidgetClient
: public FrameTestHelpers::TestWebWidgetClient {
public:
TouchActionTrackingWebWidgetClient()
- : action_set_count_(0), action_(kWebTouchActionAuto) {}
+ : action_set_count_(0), action_(TouchAction::kTouchActionAuto) {}
// WebWidgetClient methods
- void SetTouchAction(WebTouchAction touch_action) override {
+ void SetTouchAction(TouchAction touch_action) override {
action_set_count_++;
action_ = touch_action;
}
@@ -77,16 +77,16 @@ class TouchActionTrackingWebWidgetClient
// Local methods
void Reset() {
action_set_count_ = 0;
- action_ = kWebTouchActionAuto;
+ action_ = TouchAction::kTouchActionAuto;
}
int TouchActionSetCount() { return action_set_count_; }
- WebTouchAction LastTouchAction() { return action_; }
+ TouchAction LastTouchAction() { return action_; }
private:
int action_set_count_;
- WebTouchAction action_;
+ TouchAction action_;
};
const int kKfakeTouchId = 7;
@@ -339,26 +339,27 @@ void TouchActionTest::RunTestOnTree(
if (expected_action == "auto") {
// Auto is the default - no action set.
EXPECT_EQ(0, client.TouchActionSetCount()) << failure_context_pos;
- EXPECT_EQ(kWebTouchActionAuto, client.LastTouchAction())
+ EXPECT_EQ(TouchAction::kTouchActionAuto, client.LastTouchAction())
<< failure_context_pos;
} else {
// Should have received exactly one touch action.
EXPECT_EQ(1, client.TouchActionSetCount()) << failure_context_pos;
if (client.TouchActionSetCount()) {
if (expected_action == "none") {
- EXPECT_EQ(kWebTouchActionNone, client.LastTouchAction())
+ EXPECT_EQ(TouchAction::kTouchActionNone, client.LastTouchAction())
<< failure_context_pos;
} else if (expected_action == "pan-x") {
- EXPECT_EQ(kWebTouchActionPanX, client.LastTouchAction())
+ EXPECT_EQ(TouchAction::kTouchActionPanX, client.LastTouchAction())
<< failure_context_pos;
} else if (expected_action == "pan-y") {
- EXPECT_EQ(kWebTouchActionPanY, client.LastTouchAction())
+ EXPECT_EQ(TouchAction::kTouchActionPanY, client.LastTouchAction())
<< failure_context_pos;
} else if (expected_action == "pan-x-y") {
- EXPECT_EQ((kWebTouchActionPan), client.LastTouchAction())
+ EXPECT_EQ((TouchAction::kTouchActionPan), client.LastTouchAction())
<< failure_context_pos;
} else if (expected_action == "manipulation") {
- EXPECT_EQ((kWebTouchActionManipulation), client.LastTouchAction())
+ EXPECT_EQ((TouchAction::kTouchActionManipulation),
+ client.LastTouchAction())
<< failure_context_pos;
} else {
FAIL() << "Unrecognized expected-action \""
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698