| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "platform/scheduler/child/web_scheduler.h" | 32 #include "platform/scheduler/child/web_scheduler.h" |
| 33 #include "platform/scroll/ScrollAnimatorBase.h" | 33 #include "platform/scroll/ScrollAnimatorBase.h" |
| 34 #include "platform/scroll/ScrollableArea.h" | 34 #include "platform/scroll/ScrollableArea.h" |
| 35 #include "public/platform/Platform.h" | 35 #include "public/platform/Platform.h" |
| 36 #include "public/platform/WebThread.h" | 36 #include "public/platform/WebThread.h" |
| 37 #include "testing/gmock/include/gmock/gmock.h" | 37 #include "testing/gmock/include/gmock/gmock.h" |
| 38 #include "testing/gtest/include/gtest/gtest.h" | 38 #include "testing/gtest/include/gtest/gtest.h" |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 using testing::AtLeast; | 42 using ::testing::AtLeast; |
| 43 using testing::Return; | 43 using ::testing::Return; |
| 44 using testing::_; | 44 using ::testing::_; |
| 45 | 45 |
| 46 static double g_mocked_time = 0.0; | 46 static double g_mocked_time = 0.0; |
| 47 | 47 |
| 48 static double GetMockedTime() { | 48 static double GetMockedTime() { |
| 49 return g_mocked_time; | 49 return g_mocked_time; |
| 50 } | 50 } |
| 51 | 51 |
| 52 namespace { | 52 namespace { |
| 53 | 53 |
| 54 class MockScrollableArea : public GarbageCollectedFinalized<MockScrollableArea>, | 54 class MockScrollableArea : public GarbageCollectedFinalized<MockScrollableArea>, |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 ScrollAnimatorCompositorCoordinator::RunState::kPostAnimationCleanup); | 664 ScrollAnimatorCompositorCoordinator::RunState::kPostAnimationCleanup); |
| 665 EXPECT_EQ(ScrollOffset(110, 90), animator->DesiredTargetOffset()); | 665 EXPECT_EQ(ScrollOffset(110, 90), animator->DesiredTargetOffset()); |
| 666 | 666 |
| 667 Reset(*animator); | 667 Reset(*animator); |
| 668 | 668 |
| 669 // Forced GC in order to finalize objects depending on the mock object. | 669 // Forced GC in order to finalize objects depending on the mock object. |
| 670 ThreadState::Current()->CollectAllGarbage(); | 670 ThreadState::Current()->CollectAllGarbage(); |
| 671 } | 671 } |
| 672 | 672 |
| 673 } // namespace blink | 673 } // namespace blink |
| OLD | NEW |