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

Unified Diff: third_party/WebKit/Source/platform/mojo/GeometryStructTraitsTest.cpp

Issue 2928413002: Add RectF and PointF typemaps in blink. (Closed)
Patch Set: address comment Created 3 years, 6 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/platform/mojo/GeometryStructTraits.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/mojo/GeometryStructTraitsTest.cpp
diff --git a/third_party/WebKit/Source/platform/mojo/GeometryStructTraitsTest.cpp b/third_party/WebKit/Source/platform/mojo/GeometryStructTraitsTest.cpp
index 9a48f27f41944027c9abc761b6c22be1fd2b96a3..569c7c7a07ea4f141e27f7791eae6b7bca40b18d 100644
--- a/third_party/WebKit/Source/platform/mojo/GeometryStructTraitsTest.cpp
+++ b/third_party/WebKit/Source/platform/mojo/GeometryStructTraitsTest.cpp
@@ -33,9 +33,9 @@ class GeometryStructTraitsTest
NOTREACHED();
}
- void EchoPointF(gfx::mojom::blink::PointFPtr, EchoPointFCallback) override {
- // The type map is not specified.
- NOTREACHED();
+ void EchoPointF(const WebFloatPoint& p,
+ EchoPointFCallback callback) override {
+ std::move(callback).Run(p);
}
void EchoSize(const WebSize& s, EchoSizeCallback callback) override {
@@ -52,9 +52,8 @@ class GeometryStructTraitsTest
NOTREACHED();
}
- void EchoRectF(gfx::mojom::blink::RectFPtr, EchoRectFCallback) override {
- // The type map is not specified.
- NOTREACHED();
+ void EchoRectF(const WebFloatRect& r, EchoRectFCallback callback) override {
+ std::move(callback).Run(r);
}
void EchoInsets(gfx::mojom::blink::InsetsPtr, EchoInsetsCallback) override {
@@ -100,4 +99,26 @@ TEST_F(GeometryStructTraitsTest, Size) {
EXPECT_EQ(input, output);
}
+TEST_F(GeometryStructTraitsTest, PointF) {
+ const float kX = 1.234;
+ const float kY = 5.678;
+ WebFloatPoint input(kX, kY);
+ gfx::mojom::blink::GeometryTraitsTestServicePtr proxy = GetTraitsTestProxy();
+ WebFloatPoint output;
+ proxy->EchoPointF(input, &output);
+ EXPECT_EQ(input, output);
+}
+
+TEST_F(GeometryStructTraitsTest, RectF) {
+ const float kX = 1.234;
+ const float kY = 2.345;
+ const float kWidth = 3.456;
+ const float kHeight = 4.567;
+ WebFloatRect input(kX, kY, kWidth, kHeight);
+ gfx::mojom::blink::GeometryTraitsTestServicePtr proxy = GetTraitsTestProxy();
+ WebFloatRect output;
+ proxy->EchoRectF(input, &output);
+ EXPECT_EQ(input, output);
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/mojo/GeometryStructTraits.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698