| 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 "platform/graphics/CompositorMutatorClient.h" | 5 #include "platform/graphics/CompositorMutatorClient.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "platform/graphics/CompositorMutation.h" | 8 #include "platform/graphics/CompositorMutation.h" |
| 9 #include "platform/graphics/CompositorMutationsTarget.h" | 9 #include "platform/graphics/CompositorMutationsTarget.h" |
| 10 #include "platform/graphics/CompositorMutator.h" | 10 #include "platform/graphics/CompositorMutator.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "wtf/OwnPtr.h" | 13 #include "wtf/OwnPtr.h" |
| 14 | 14 |
| 15 using ::testing::_; | 15 using ::testing::_; |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 class StubCompositorMutator : public CompositorMutator { | 20 class StubCompositorMutator : public CompositorMutator { |
| 21 public: | 21 public: |
| 22 StubCompositorMutator() {} | 22 StubCompositorMutator() {} |
| 23 | 23 |
| 24 bool mutate(double monotonicTimeNow) override { return false; } | 24 bool mutate(double monotonicTimeNow, |
| 25 CompositorMutableStateProvider* stateProvider) override |
| 26 { |
| 27 return false; |
| 28 } |
| 25 }; | 29 }; |
| 26 | 30 |
| 27 class MockCompositoMutationsTarget : public CompositorMutationsTarget { | 31 class MockCompositoMutationsTarget : public CompositorMutationsTarget { |
| 28 public: | 32 public: |
| 29 MOCK_METHOD1(applyMutations, void(CompositorMutations*)); | 33 MOCK_METHOD1(applyMutations, void(CompositorMutations*)); |
| 30 }; | 34 }; |
| 31 | 35 |
| 32 TEST(CompositorMutatorClient, CallbackForNonNullMutationsShouldApply) | 36 TEST(CompositorMutatorClient, CallbackForNonNullMutationsShouldApply) |
| 33 { | 37 { |
| 34 MockCompositoMutationsTarget target; | 38 MockCompositoMutationsTarget target; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 45 { | 49 { |
| 46 MockCompositoMutationsTarget target; | 50 MockCompositoMutationsTarget target; |
| 47 CompositorMutatorClient client(new StubCompositorMutator, &target); | 51 CompositorMutatorClient client(new StubCompositorMutator, &target); |
| 48 | 52 |
| 49 EXPECT_CALL(target, applyMutations(_)).Times(0); | 53 EXPECT_CALL(target, applyMutations(_)).Times(0); |
| 50 EXPECT_TRUE(client.TakeMutations().is_null()); | 54 EXPECT_TRUE(client.TakeMutations().is_null()); |
| 51 } | 55 } |
| 52 | 56 |
| 53 } // namespace | 57 } // namespace |
| 54 } // namespace blink | 58 } // namespace blink |
| OLD | NEW |