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 |