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

Unified Diff: ash/test/test_volume_control_delegate.h

Issue 251193005: Enabled volume buttons when TouchView is active (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merged changes with trunk Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/ash.gyp ('k') | ash/test/test_volume_control_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/test_volume_control_delegate.h
diff --git a/ash/test/test_volume_control_delegate.h b/ash/test/test_volume_control_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..85b3e5dec4c4d18f9eded5f10be92579abffa382
--- /dev/null
+++ b/ash/test/test_volume_control_delegate.h
@@ -0,0 +1,56 @@
+// 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.
+
+#ifndef ASH_TEST_TEST_VOLUME_CONTROL_DELEGATE_H_
+#define ASH_TEST_TEST_VOLUME_CONTROL_DELEGATE_H_
+
+#include "ash/volume_control_delegate.h"
+#include "ui/base/accelerators/accelerator.h"
+
+namespace ash {
+
+// A simple test double for a VolumeControlDelegate
+// Will count the number of times the HandleVolumeMute, HandleVolumeDown and
+// HandleVolumeUp methods are invoked.
+class TestVolumeControlDelegate : public ash::VolumeControlDelegate {
+ public:
+ explicit TestVolumeControlDelegate(bool consume);
+ virtual ~TestVolumeControlDelegate();
+
+ int handle_volume_mute_count() const {
+ return handle_volume_mute_count_;
+ }
+
+ int handle_volume_down_count() const {
+ return handle_volume_down_count_;
+ }
+
+ int handle_volume_up_count() const {
+ return handle_volume_up_count_;
+ }
+
+ const ui::Accelerator& last_accelerator() const {
+ return last_accelerator_;
+ }
+
+ // ash::VolumeControlDelegate:
+ virtual bool HandleVolumeMute(const ui::Accelerator& accelerator) OVERRIDE;
+ virtual bool HandleVolumeDown(const ui::Accelerator& accelerator) OVERRIDE;
+ virtual bool HandleVolumeUp(const ui::Accelerator& accelerator) OVERRIDE;
+
+ private:
+ // Keeps track of the return value that should be used for the methods
+ // inherited from VolumeControlDelegate
+ bool consume_;
+ int handle_volume_mute_count_;
+ int handle_volume_down_count_;
+ int handle_volume_up_count_;
+ ui::Accelerator last_accelerator_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestVolumeControlDelegate);
+};
+
+} // namespace ash
+
+#endif // ASH_TEST_TEST_VOLUME_CONTROL_DELEGATE_H_
« no previous file with comments | « ash/ash.gyp ('k') | ash/test/test_volume_control_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698