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

Unified Diff: skia/public/interfaces/test/struct_traits_unittest.cc

Issue 2096763005: Provide StructTraits for a vector<SkBitmap> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 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 | « skia/public/interfaces/test/OWNERS ('k') | skia/public/interfaces/test/traits_test_service.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/public/interfaces/test/struct_traits_unittest.cc
diff --git a/skia/public/interfaces/test/struct_traits_unittest.cc b/skia/public/interfaces/test/struct_traits_unittest.cc
index 7a18033fbea21cc9110743e611170f6dcea6f39f..26437059c1f3f1ae0b819ed163f4a41af32bd785 100644
--- a/skia/public/interfaces/test/struct_traits_unittest.cc
+++ b/skia/public/interfaces/test/struct_traits_unittest.cc
@@ -32,6 +32,11 @@ class StructTraitsTest : public testing::Test, public mojom::TraitsTestService {
callback.Run(b);
}
+ void EchoBitmapArray(const std::vector<SkBitmap>& t,
+ const EchoBitmapArrayCallback& callback) override {
+ callback.Run(t);
+ }
+
void EchoImageFilter(const sk_sp<SkImageFilter>& i,
const EchoImageFilterCallback& callback) override {
callback.Run(i);
@@ -103,4 +108,28 @@ TEST_F(StructTraitsTest, DropShadowImageFilter) {
EXPECT_EQ(input_str, output_str);
}
+TEST_F(StructTraitsTest, BitmapArray) {
+ SkBitmap b1, b2;
+
+ SkImageInfo image_info1 = SkImageInfo::MakeN32(10, 5, kPremul_SkAlphaType);
+ b1.allocPixels(image_info1);
+
+ SkImageInfo image_info2 = SkImageInfo::MakeN32(11, 6, kPremul_SkAlphaType);
+ b2.allocPixels(image_info2);
+
+ std::vector<SkBitmap> vi;
+ vi.push_back(b1);
+ vi.push_back(b2);
+
+ mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy();
+ std::vector<SkBitmap> vo;
+ proxy->EchoBitmapArray(vi, &vo);
+
+ EXPECT_EQ(vi.size(), vo.size());
+ for (size_t i = 0; i < vi.size(); i++) {
+ EXPECT_EQ(vi[i].width(), vo[i].width());
+ EXPECT_EQ(vi[i].height(), vo[i].height());
+ }
+}
+
} // namespace skia
« no previous file with comments | « skia/public/interfaces/test/OWNERS ('k') | skia/public/interfaces/test/traits_test_service.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698