Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "cc/input/browser_controls_offset_manager.h" | 5 #include "cc/input/browser_controls_offset_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 494 EXPECT_FLOAT_EQ(0.8f, manager->BottomControlsShownRatio()); | 494 EXPECT_FLOAT_EQ(0.8f, manager->BottomControlsShownRatio()); |
| 495 manager->ScrollEnd(); | 495 manager->ScrollEnd(); |
| 496 | 496 |
| 497 manager->ScrollBegin(); | 497 manager->ScrollBegin(); |
| 498 manager->ScrollBy(gfx::Vector2dF(0.f, -200.f)); | 498 manager->ScrollBy(gfx::Vector2dF(0.f, -200.f)); |
| 499 EXPECT_FLOAT_EQ(100.f, manager->ContentBottomOffset()); | 499 EXPECT_FLOAT_EQ(100.f, manager->ContentBottomOffset()); |
| 500 EXPECT_FLOAT_EQ(1.f, manager->BottomControlsShownRatio()); | 500 EXPECT_FLOAT_EQ(1.f, manager->BottomControlsShownRatio()); |
| 501 manager->ScrollEnd(); | 501 manager->ScrollEnd(); |
| 502 } | 502 } |
| 503 | 503 |
| 504 TEST(BrowserControlsOffsetManagerTest, | 504 TEST(BrowserControlsOffsetManagerTest, |
|
aelias_OOO_until_Jul13
2016/11/01 21:15:46
Could you add a new CC test covering the bug you'r
| |
| 505 ScrollThenRestoreBottomControlsNoBrowserControls) { | 505 ScrollThenRestoreBottomControlsNoTopControls) { |
|
aelias_OOO_until_Jul13
2016/11/01 21:15:46
Another rebase issue.
| |
| 506 MockBrowserControlsOffsetManagerClient client(0.f, 0.5f, 0.5f); | 506 MockBrowserControlsOffsetManagerClient client(0.f, 0.5f, 0.5f); |
| 507 client.SetBottomControlsHeight(100.f); | 507 client.SetBottomControlsHeight(100.f); |
| 508 BrowserControlsOffsetManager* manager = client.manager(); | 508 BrowserControlsOffsetManager* manager = client.manager(); |
| 509 manager->ScrollBegin(); | 509 manager->ScrollBegin(); |
| 510 manager->ScrollBy(gfx::Vector2dF(0.f, 20.f)); | 510 manager->ScrollBy(gfx::Vector2dF(0.f, 20.f)); |
| 511 EXPECT_FLOAT_EQ(80.f, manager->ContentBottomOffset()); | 511 EXPECT_FLOAT_EQ(80.f, manager->ContentBottomOffset()); |
| 512 EXPECT_FLOAT_EQ(0.8f, manager->BottomControlsShownRatio()); | 512 EXPECT_FLOAT_EQ(0.8f, manager->BottomControlsShownRatio()); |
| 513 manager->ScrollEnd(); | 513 manager->ScrollEnd(); |
| 514 | 514 |
| 515 manager->ScrollBegin(); | 515 manager->ScrollBegin(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 547 EXPECT_TRUE(manager->has_animation()); | 547 EXPECT_TRUE(manager->has_animation()); |
| 548 EXPECT_FLOAT_EQ(1.f, client.CurrentBrowserControlsShownRatio()); | 548 EXPECT_FLOAT_EQ(1.f, client.CurrentBrowserControlsShownRatio()); |
| 549 | 549 |
| 550 manager->UpdateBrowserControlsState(BOTH, SHOWN, true); | 550 manager->UpdateBrowserControlsState(BOTH, SHOWN, true); |
| 551 EXPECT_FALSE(manager->has_animation()); | 551 EXPECT_FALSE(manager->has_animation()); |
| 552 EXPECT_FLOAT_EQ(1.f, client.CurrentBrowserControlsShownRatio()); | 552 EXPECT_FLOAT_EQ(1.f, client.CurrentBrowserControlsShownRatio()); |
| 553 } | 553 } |
| 554 | 554 |
| 555 } // namespace | 555 } // namespace |
| 556 } // namespace cc | 556 } // namespace cc |
| OLD | NEW |