summaryrefslogtreecommitdiffstats
path: root/ash/test
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-08 16:54:53 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-08 16:54:53 +0000
commit0c68e894ddf194189fcbab079b97cf6ff47929da (patch)
treeec2a9b57930c30dc4bcf2bae73b86c4555de40fd /ash/test
parent486238b191a6d7439dcda4aa04c662e2e3edd608 (diff)
downloadchromium_src-0c68e894ddf194189fcbab079b97cf6ff47929da.zip
chromium_src-0c68e894ddf194189fcbab079b97cf6ff47929da.tar.gz
chromium_src-0c68e894ddf194189fcbab079b97cf6ff47929da.tar.bz2
[Clenup] Split ShellTestApi into separate file
BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/11476032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171977 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/test')
-rw-r--r--ash/test/shell_test_api.cc39
-rw-r--r--ash/test/shell_test_api.h48
2 files changed, 87 insertions, 0 deletions
diff --git a/ash/test/shell_test_api.cc b/ash/test/shell_test_api.cc
new file mode 100644
index 0000000..34e6535
--- /dev/null
+++ b/ash/test/shell_test_api.cc
@@ -0,0 +1,39 @@
+// Copyright (c) 2012 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/shell_test_api.h"
+
+#include "ash/root_window_controller.h"
+#include "ash/shell.h"
+
+namespace ash {
+namespace test {
+
+ShellTestApi::ShellTestApi(Shell* shell) : shell_(shell) {}
+
+internal::RootWindowLayoutManager* ShellTestApi::root_window_layout() {
+ return shell_->GetPrimaryRootWindowController()->root_window_layout();
+}
+
+views::corewm::InputMethodEventFilter*
+ShellTestApi::input_method_event_filter() {
+ return shell_->input_method_filter_.get();
+}
+
+internal::SystemGestureEventFilter*
+ShellTestApi::system_gesture_event_filter() {
+ return shell_->system_gesture_filter_.get();
+}
+
+internal::WorkspaceController* ShellTestApi::workspace_controller() {
+ return shell_->GetPrimaryRootWindowController()->workspace_controller();
+}
+
+internal::ScreenPositionController*
+ShellTestApi::screen_position_controller() {
+ return shell_->screen_position_controller_.get();
+}
+
+} // namespace test
+} // namespace ash
diff --git a/ash/test/shell_test_api.h b/ash/test/shell_test_api.h
new file mode 100644
index 0000000..6830a07
--- /dev/null
+++ b/ash/test/shell_test_api.h
@@ -0,0 +1,48 @@
+// Copyright (c) 2012 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_SHELL_TEST_API_H_
+#define ASH_TEST_SHELL_TEST_API_H_
+
+#include "base/basictypes.h"
+
+namespace views {
+namespace corewm {
+class InputMethodEventFilter;
+} // namespace corewm
+} // namespace views
+
+namespace ash {
+class Shell;
+
+namespace internal {
+class RootWindowLayoutManager;
+class ScreenPositionController;
+class SystemGestureEventFilter;
+class WorkspaceController;
+} // namespace internal
+
+namespace test {
+
+// Accesses private data from a Shell for testing.
+class ShellTestApi {
+public:
+ explicit ShellTestApi(Shell* shell);
+
+ internal::RootWindowLayoutManager* root_window_layout();
+ views::corewm::InputMethodEventFilter* input_method_event_filter();
+ internal::SystemGestureEventFilter* system_gesture_event_filter();
+ internal::WorkspaceController* workspace_controller();
+ internal::ScreenPositionController* screen_position_controller();
+
+ private:
+ Shell* shell_; // not owned
+
+ DISALLOW_COPY_AND_ASSIGN(ShellTestApi);
+};
+
+} // namespace test
+} // namespace ash
+
+#endif // ASH_TEST_SHELL_TEST_API_H_