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

Unified Diff: ash/test/volume_control_delegate_stub.h

Issue 251193005: Enabled volume buttons when TouchView is active (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Rob's comments from patch set 3 Created 6 years, 8 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
Index: ash/test/volume_control_delegate_stub.h
diff --git a/ash/test/volume_control_delegate_stub.h b/ash/test/volume_control_delegate_stub.h
new file mode 100644
index 0000000000000000000000000000000000000000..0225d097474f9a7f085b0c90d7cae256db058c76
--- /dev/null
+++ b/ash/test/volume_control_delegate_stub.h
@@ -0,0 +1,55 @@
+// 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_VOLUME_CONTROL_DELEGATE_STUB_H_
+#define ASH_TEST_VOLUME_CONTROL_DELEGATE_STUB_H_
+
+#include "ash/volume_control_delegate.h"
+#include "ui/base/accelerators/accelerator.h"
+
+namespace ash {
+
+// A simple TestDouble for a VolumeControlDelegate
flackr 2014/04/30 14:27:44 TestDouble?
bruthig 2014/04/30 15:36:16 "A test double is an object that can stand in for
flackr 2014/04/30 15:43:10 Ah okay, I hadn't heard the term before and the Ti
+// Will count the number of times the HandleVolumeMute, HandleVolumeDown and
+// HandleVolumeUp methods are invoked and will return a predefined value from
+// these methods. The predefined value is defined upon construction.
flackr 2014/04/30 14:27:44 No need to mention the predefined consume value. h
bruthig 2014/04/30 15:36:16 Done.
+class VolumeControlDelegateStub : public ash::VolumeControlDelegate {
flackr 2014/04/30 14:27:44 For consistency, it looks like the other mock impl
bruthig 2014/04/30 15:36:16 For consistency I've renamed it to TestVolumeContr
bruthig 2014/04/30 15:36:16 Done.
+ public:
+ explicit VolumeControlDelegateStub(bool consume);
+ virtual ~VolumeControlDelegateStub();
+
+ 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:
+ bool consume_;
flackr 2014/04/30 14:27:44 Can comment what consume means here instead.
bruthig 2014/04/30 15:36:16 Done.
+ int handle_volume_mute_count_;
+ int handle_volume_down_count_;
+ int handle_volume_up_count_;
+ ui::Accelerator last_accelerator_;
+
+ DISALLOW_COPY_AND_ASSIGN(VolumeControlDelegateStub);
+};
+
+} // namespace ash
+
+#endif // ASH_TEST_VOLUME_CONTROL_DELEGATE_STUB_H_

Powered by Google App Engine
This is Rietveld 408576698