Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "ash/ash_touch_exploration_manager_chromeos.h" | |
| 6 | |
| 7 #include "ash/root_window_controller.h" | |
| 8 #include "ash/shell.h" | |
| 9 #include "ash/test/ash_test_base.h" | |
| 10 #include "chromeos/audio/cras_audio_handler.h" | |
| 11 | |
| 12 namespace ash { | |
| 13 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.
| |
| 14 | |
| 15 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.
| |
| 16 }; | |
| 17 | |
| 18 TEST_F(AshTouchExplorationManagerTest, AdjustSound) { | |
| 19 RootWindowController* controller = Shell::GetPrimaryRootWindowController(); | |
| 20 AshTouchExplorationManagerChromeOS* touch_exploration_manager = | |
| 21 new AshTouchExplorationManagerChromeOS(controller); | |
| 22 touch_exploration_manager->SetOutputLevel(10); | |
| 23 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.
| |
| 24 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.
| |
| 25 | |
| 26 touch_exploration_manager->SetOutputLevel(100); | |
| 27 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.
| |
| 28 | |
| 29 touch_exploration_manager->SetOutputLevel(0); | |
| 30 EXPECT_TRUE(audio_handler_->IsOutputMuted()); | |
| 31 EXPECT_EQ(audio_handler_->GetOutputVolumePercent(), 0); | |
| 32 } | |
| 33 | |
| 34 } // namespace test | |
| 35 } // namespace ash | |
|
James Cook
2014/07/15 22:40:37
Hooray, we have a test! Now the next test will be
| |
| OLD | NEW |