OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "services/ui/public/cpp/property_type_converters.h" | |
6 | |
7 #include "testing/gtest/include/gtest/gtest.h" | |
8 #include "third_party/skia/include/core/SkBitmap.h" | |
9 #include "ui/gfx/skia_util.h" | |
10 | |
11 namespace mojo { | |
12 namespace { | |
13 | |
14 // Tests round-trip serializing and deserializing an SkBitmap. | |
15 TEST(PropertyTypeConvertersTest, SkBitmapRoundTrip) { | |
sky
2017/01/23 16:42:38
Aren't we still using property type converter?
sadrul
2017/01/23 17:40:09
Good catch! Restored this.
Although, would it mak
| |
16 SkBitmap bitmap; | |
17 bitmap.allocN32Pixels(16, 32); | |
18 bitmap.eraseARGB(255, 11, 22, 33); | |
19 EXPECT_FALSE(bitmap.isNull()); | |
20 auto bytes = TypeConverter<std::vector<uint8_t>, SkBitmap>::Convert(bitmap); | |
21 SkBitmap out = TypeConverter<SkBitmap, std::vector<uint8_t>>::Convert(bytes); | |
22 EXPECT_TRUE(gfx::BitmapsAreEqual(bitmap, out)); | |
23 } | |
24 | |
25 } // namespace | |
26 } // namespace mojo | |
OLD | NEW |