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

Unified Diff: cc/base/region_unittest.cc

Issue 1460503004: Add support for converting cc::Region to and from protobuf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-more-conversions
Patch Set: Created 5 years, 1 month 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
« cc/base/region.cc ('K') | « cc/base/region.cc ('k') | cc/cc.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/region_unittest.cc
diff --git a/cc/base/region_unittest.cc b/cc/base/region_unittest.cc
index c9a218d692a7b95f68f8c6fb693ae9c2563b86bc..99a17b2f877aaf48b7e4a20c6329767cd011e50c 100644
--- a/cc/base/region_unittest.cc
+++ b/cc/base/region_unittest.cc
@@ -4,6 +4,7 @@
#include "cc/base/region.h"
+#include "cc/proto/region.pb.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cc {
@@ -450,5 +451,14 @@ TEST(RegionSwap, Swap) {
EXPECT_EQ(r2.ToString(), r3.ToString());
}
+TEST(RegionTest, ProtoConversion) {
+ Region region1(gfx::Rect(14, 15, 16, 17));
+ proto::Region proto;
+ region1.ToProtobuf(&proto);
+ Region region2;
+ region2.FromProtobuf(proto);
+ EXPECT_EQ(region1, region2);
+}
+
} // namespace
} // namespace cc
« cc/base/region.cc ('K') | « cc/base/region.cc ('k') | cc/cc.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698