| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
| 6 #include "mojo/public/cpp/bindings/binding_set.h" | 6 #include "mojo/public/cpp/bindings/binding_set.h" |
| 7 #include "skia/public/interfaces/test/traits_test_service.mojom.h" | 7 #include "skia/public/interfaces/test/traits_test_service.mojom.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "third_party/skia/include/core/SkColorFilter.h" | 9 #include "third_party/skia/include/core/SkColorFilter.h" |
| 10 #include "third_party/skia/include/core/SkString.h" | 10 #include "third_party/skia/include/core/SkString.h" |
| 11 #include "third_party/skia/include/effects/SkColorFilterImageFilter.h" | 11 #include "third_party/skia/include/effects/SkColorFilterImageFilter.h" |
| 12 #include "third_party/skia/include/effects/SkDropShadowImageFilter.h" |
| 12 | 13 |
| 13 namespace skia { | 14 namespace skia { |
| 14 | 15 |
| 15 namespace { | 16 namespace { |
| 16 | 17 |
| 17 class StructTraitsTest : public testing::Test, public mojom::TraitsTestService { | 18 class StructTraitsTest : public testing::Test, public mojom::TraitsTestService { |
| 18 public: | 19 public: |
| 19 StructTraitsTest() {} | 20 StructTraitsTest() {} |
| 20 | 21 |
| 21 protected: | 22 protected: |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 SkString input_str; | 54 SkString input_str; |
| 54 input->toString(&input_str); | 55 input->toString(&input_str); |
| 55 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); | 56 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); |
| 56 sk_sp<SkImageFilter> output; | 57 sk_sp<SkImageFilter> output; |
| 57 proxy->EchoImageFilter(input, &output); | 58 proxy->EchoImageFilter(input, &output); |
| 58 SkString output_str; | 59 SkString output_str; |
| 59 output->toString(&output_str); | 60 output->toString(&output_str); |
| 60 EXPECT_EQ(input_str, output_str); | 61 EXPECT_EQ(input_str, output_str); |
| 61 } | 62 } |
| 62 | 63 |
| 64 TEST_F(StructTraitsTest, DropShadowImageFilter) { |
| 65 sk_sp<SkImageFilter> input(SkDropShadowImageFilter::Make( |
| 66 SkIntToScalar(3), SkIntToScalar(8), SkIntToScalar(4), SkIntToScalar(9), |
| 67 SK_ColorBLACK, |
| 68 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, nullptr)); |
| 69 SkString input_str; |
| 70 input->toString(&input_str); |
| 71 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); |
| 72 sk_sp<SkImageFilter> output; |
| 73 proxy->EchoImageFilter(input, &output); |
| 74 SkString output_str; |
| 75 output->toString(&output_str); |
| 76 EXPECT_EQ(input_str, output_str); |
| 77 } |
| 78 |
| 63 } // namespace skia | 79 } // namespace skia |
| OLD | NEW |