Chromium Code Reviews| Index: ash/ash_touch_exploration_manager_unittest.cc |
| diff --git a/ash/ash_touch_exploration_manager_unittest.cc b/ash/ash_touch_exploration_manager_unittest.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..28151ee1d0a5c9def50d5d5d8ffb59fa2c22dadb |
| --- /dev/null |
| +++ b/ash/ash_touch_exploration_manager_unittest.cc |
| @@ -0,0 +1,35 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "ash/ash_touch_exploration_manager_chromeos.h" |
| + |
| +#include "ash/root_window_controller.h" |
| +#include "ash/shell.h" |
| +#include "ash/test/ash_test_base.h" |
| +#include "chromeos/audio/cras_audio_handler.h" |
| + |
| +namespace ash { |
| +namespace test { |
|
James Cook
2014/07/15 22:40:36
I don't generally put the tests themselves in the
lisayin
2014/07/15 23:54:46
Done.
|
| + |
| +class AshTouchExplorationManagerTest : public test::AshTestBase { |
|
James Cook
2014/07/15 22:40:37
optional: You can also do "typedef test::AshTestBa
lisayin
2014/07/15 23:54:46
Done.
|
| +}; |
| + |
| +TEST_F(AshTouchExplorationManagerTest, AdjustSound) { |
| + RootWindowController* controller = Shell::GetPrimaryRootWindowController(); |
| + AshTouchExplorationManagerChromeOS* touch_exploration_manager = |
| + new AshTouchExplorationManagerChromeOS(controller); |
| + touch_exploration_manager->SetOutputLevel(10); |
| + chromeos::CrasAudioHandler* audio_handler_(chromeos::CrasAudioHandler::Get()); |
|
James Cook
2014/07/15 22:40:37
"audio_handler" not "audio_handler_" since this is
lisayin
2014/07/15 23:54:46
Done.
|
| + EXPECT_EQ(audio_handler_->GetOutputVolumePercent(), 10); |
|
James Cook
2014/07/15 22:40:36
Expect not muted?
lisayin
2014/07/15 23:54:46
Done.
|
| + |
| + touch_exploration_manager->SetOutputLevel(100); |
| + EXPECT_EQ(audio_handler_->GetOutputVolumePercent(), 100); |
|
James Cook
2014/07/15 22:40:36
Expect not muted?
lisayin
2014/07/15 23:54:45
Done.
|
| + |
| + touch_exploration_manager->SetOutputLevel(0); |
| + EXPECT_TRUE(audio_handler_->IsOutputMuted()); |
| + EXPECT_EQ(audio_handler_->GetOutputVolumePercent(), 0); |
| +} |
| + |
| +} // namespace test |
| +} // namespace ash |
|
James Cook
2014/07/15 22:40:37
Hooray, we have a test! Now the next test will be
|