Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: chrome/browser/ui/ash/volume_controller_browsertest_chromeos.cc

Issue 10873085: Implement two new policies to control muting the audio I/O. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to ToT. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/ui/ash/volume_controller_chromeos.h" 5 #include "chrome/browser/ui/ash/volume_controller_chromeos.h"
6 6
7 #include "chrome/browser/chromeos/audio/audio_handler.h" 7 #include "chrome/browser/chromeos/audio/audio_handler.h"
8 #include "chrome/browser/chromeos/audio/audio_mixer.h" 8 #include "chrome/browser/chromeos/audio/audio_mixer.h"
9 #include "chrome/test/base/in_process_browser_test.h" 9 #include "chrome/test/base/in_process_browser_test.h"
10 #include "chrome/test/base/ui_test_utils.h" 10 #include "chrome/test/base/ui_test_utils.h"
(...skipping 16 matching lines...) Expand all
27 } 27 }
28 28
29 virtual void SetVolumePercent(double percent) OVERRIDE { 29 virtual void SetVolumePercent(double percent) OVERRIDE {
30 volume_ = percent; 30 volume_ = percent;
31 } 31 }
32 32
33 virtual bool IsMuted() OVERRIDE { 33 virtual bool IsMuted() OVERRIDE {
34 return is_muted_; 34 return is_muted_;
35 } 35 }
36 36
37 virtual void SetMuted(bool do_mute) OVERRIDE { 37 virtual void SetMuted(bool mute) OVERRIDE {
38 is_muted_ = do_mute; 38 is_muted_ = mute;
39 }
40
41 bool IsMuteLocked() OVERRIDE {
42 return is_mute_locked_;
43 }
44
45 void SetMuteLocked(bool locked) OVERRIDE {
46 is_mute_locked_ = locked;
47 }
48
49 bool IsCaptureMuted() OVERRIDE {
50 return is_capture_muted_;
51 }
52
53 void SetCaptureMuted(bool mute) OVERRIDE {
54 is_capture_muted_ = mute;
55 }
56
57 bool IsCaptureMuteLocked() OVERRIDE {
58 return is_capture_mute_locked_;
59 }
60
61 void SetCaptureMuteLocked(bool locked) OVERRIDE {
62 is_capture_mute_locked_ = locked;
39 } 63 }
40 64
41 private: 65 private:
42 double volume_; 66 double volume_;
43 bool is_muted_; 67 bool is_muted_;
68 bool is_mute_locked_;
69 bool is_capture_muted_;
70 bool is_capture_mute_locked_;
44 71
45 DISALLOW_COPY_AND_ASSIGN(MockAudioMixer); 72 DISALLOW_COPY_AND_ASSIGN(MockAudioMixer);
46 }; 73 };
47 74
48 // This class has to be browsertest because AudioHandler uses prefs_service. 75 // This class has to be browsertest because AudioHandler uses prefs_service.
49 class VolumeControllerTest : public InProcessBrowserTest { 76 class VolumeControllerTest : public InProcessBrowserTest {
50 public: 77 public:
51 VolumeControllerTest() {} 78 VolumeControllerTest() {}
52 79
53 virtual void SetUpOnMainThread() OVERRIDE { 80 virtual void SetUpOnMainThread() OVERRIDE {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 EXPECT_DOUBLE_EQ(0.0, audio_mixer()->GetVolumePercent()); 172 EXPECT_DOUBLE_EQ(0.0, audio_mixer()->GetVolumePercent());
146 173
147 // Thus, further VolumeUp doesn't recover the volume, it's just slightly 174 // Thus, further VolumeUp doesn't recover the volume, it's just slightly
148 // bigger than 0. 175 // bigger than 0.
149 VolumeUp(); 176 VolumeUp();
150 EXPECT_LT(0.0, audio_mixer()->GetVolumePercent()); 177 EXPECT_LT(0.0, audio_mixer()->GetVolumePercent());
151 EXPECT_GT(initial_volume, audio_mixer()->GetVolumePercent()); 178 EXPECT_GT(initial_volume, audio_mixer()->GetVolumePercent());
152 } 179 }
153 180
154 } // namespace 181 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/policy/configuration_policy_pref_store_unittest.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698