| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 5 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 .SetFirstDisplayAsInternalDisplay(); | 86 .SetFirstDisplayAsInternalDisplay(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void TearDown() override { | 89 void TearDown() override { |
| 90 chromeos::AccelerometerReader::GetInstance()->AddObserver( | 90 chromeos::AccelerometerReader::GetInstance()->AddObserver( |
| 91 maximize_mode_controller()); | 91 maximize_mode_controller()); |
| 92 test::AshTestBase::TearDown(); | 92 test::AshTestBase::TearDown(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 MaximizeModeController* maximize_mode_controller() { | 95 MaximizeModeController* maximize_mode_controller() { |
| 96 return WmShell::Get()->maximize_mode_controller(); | 96 return Shell::Get()->maximize_mode_controller(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void TriggerLidUpdate(const gfx::Vector3dF& lid) { | 99 void TriggerLidUpdate(const gfx::Vector3dF& lid) { |
| 100 scoped_refptr<chromeos::AccelerometerUpdate> update( | 100 scoped_refptr<chromeos::AccelerometerUpdate> update( |
| 101 new chromeos::AccelerometerUpdate()); | 101 new chromeos::AccelerometerUpdate()); |
| 102 update->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, lid.x(), lid.y(), | 102 update->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, lid.x(), lid.y(), |
| 103 lid.z()); | 103 lid.z()); |
| 104 maximize_mode_controller()->OnAccelerometerUpdated(update); | 104 maximize_mode_controller()->OnAccelerometerUpdated(update); |
| 105 } | 105 } |
| 106 | 106 |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 kAccelerometerVerticalHingeUnstableAnglesTestData[i * 6 + 4], | 573 kAccelerometerVerticalHingeUnstableAnglesTestData[i * 6 + 4], |
| 574 kAccelerometerVerticalHingeUnstableAnglesTestData[i * 6 + 5]); | 574 kAccelerometerVerticalHingeUnstableAnglesTestData[i * 6 + 5]); |
| 575 TriggerBaseAndLidUpdate(base, lid); | 575 TriggerBaseAndLidUpdate(base, lid); |
| 576 // There are a lot of samples, so ASSERT rather than EXPECT to only generate | 576 // There are a lot of samples, so ASSERT rather than EXPECT to only generate |
| 577 // one failure rather than potentially hundreds. | 577 // one failure rather than potentially hundreds. |
| 578 ASSERT_TRUE(IsMaximizeModeStarted()); | 578 ASSERT_TRUE(IsMaximizeModeStarted()); |
| 579 } | 579 } |
| 580 } | 580 } |
| 581 | 581 |
| 582 } // namespace ash | 582 } // namespace ash |
| OLD | NEW |