summaryrefslogtreecommitdiffstats
path: root/ash/test
diff options
context:
space:
mode:
authorflackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-11 01:41:36 +0000
committerflackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-11 01:41:36 +0000
commit587926ad68c76c7224d27d831cdca9e5606310f2 (patch)
tree5cf53bd488d848e7f5668e15802330fa5248a2b5 /ash/test
parent78937bb4359485e8247d047e66e1e10de6a6de1f (diff)
downloadchromium_src-587926ad68c76c7224d27d831cdca9e5606310f2.zip
chromium_src-587926ad68c76c7224d27d831cdca9e5606310f2.tar.gz
chromium_src-587926ad68c76c7224d27d831cdca9e5606310f2.tar.bz2
Take a screenshot in maximize mode when volume down and power are pressed.
BUG=363732 TEST=MaximizeModeControllerTest.Screenshot TEST=When device is in maximize mode, hold volume down and press power to take a screenshot. Review URL: https://codereview.chromium.org/263813002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269684 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/test')
-rw-r--r--ash/test/test_lock_state_controller_delegate.cc27
-rw-r--r--ash/test/test_lock_state_controller_delegate.h37
2 files changed, 64 insertions, 0 deletions
diff --git a/ash/test/test_lock_state_controller_delegate.cc b/ash/test/test_lock_state_controller_delegate.cc
new file mode 100644
index 0000000..55e46ac
--- /dev/null
+++ b/ash/test/test_lock_state_controller_delegate.cc
@@ -0,0 +1,27 @@
+// 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/test/test_lock_state_controller_delegate.h"
+
+namespace ash {
+namespace test {
+
+TestLockStateControllerDelegate::TestLockStateControllerDelegate()
+ : num_lock_requests_(0),
+ num_shutdown_requests_(0) {
+}
+
+TestLockStateControllerDelegate::~TestLockStateControllerDelegate() {
+}
+
+void TestLockStateControllerDelegate::RequestLockScreen() {
+ ++num_lock_requests_;
+}
+
+void TestLockStateControllerDelegate::RequestShutdown() {
+ ++num_shutdown_requests_;
+}
+
+} // namespace test
+} // namespace ash
diff --git a/ash/test/test_lock_state_controller_delegate.h b/ash/test/test_lock_state_controller_delegate.h
new file mode 100644
index 0000000..1e1892c
--- /dev/null
+++ b/ash/test/test_lock_state_controller_delegate.h
@@ -0,0 +1,37 @@
+// 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_LOCK_STATE_CONTROLLER_DELEGATE_H_
+#define ASH_TEST_TEST_LOCK_STATE_CONTROLLER_DELEGATE_H_
+
+#include "ash/wm/lock_state_controller.h"
+
+namespace ash {
+namespace test {
+
+// Fake implementation of PowerButtonControllerDelegate that just logs requests
+// to lock the screen and shut down the device.
+class TestLockStateControllerDelegate : public LockStateControllerDelegate {
+ public:
+ TestLockStateControllerDelegate();
+ virtual ~TestLockStateControllerDelegate();
+
+ int num_lock_requests() const { return num_lock_requests_; }
+ int num_shutdown_requests() const { return num_shutdown_requests_; }
+
+ // LockStateControllerDelegate implementation.
+ virtual void RequestLockScreen() OVERRIDE;
+ virtual void RequestShutdown() OVERRIDE;
+
+ private:
+ int num_lock_requests_;
+ int num_shutdown_requests_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestLockStateControllerDelegate);
+};
+
+} // namespace test
+} // namespace ash
+
+#endif // ASH_TEST_TEST_LOCK_STATE_CONTROLLER_DELEGATE_H_