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

Unified Diff: ui/aura_shell/workspace_controller_unittest.cc

Issue 8894018: Move the concept of Activation to the Shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years 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 | « ui/aura_shell/workspace_controller.cc ('k') | ui/views/test/views_test_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/workspace_controller_unittest.cc
===================================================================
--- ui/aura_shell/workspace_controller_unittest.cc (revision 114022)
+++ ui/aura_shell/workspace_controller_unittest.cc (working copy)
@@ -7,6 +7,9 @@
#include "ui/aura/test/aura_test_base.h"
#include "ui/aura/test/test_stacking_client.h"
#include "ui/aura/window.h"
+#include "ui/aura_shell/activation_controller.h"
+#include "ui/aura_shell/shell_window_ids.h"
+#include "ui/aura_shell/window_util.h"
#include "ui/aura_shell/workspace/workspace.h"
#include "ui/aura_shell/workspace/workspace_manager.h"
@@ -23,10 +26,17 @@
virtual void SetUp() OVERRIDE {
aura::test::AuraTestBase::SetUp();
contents_view_ = GetTestStackingClient()->default_container();
+ // Activatable windows need to be in a container the ActivationController
+ // recognizes.
+ contents_view_->set_id(
+ aura_shell::internal::kShellWindowId_DefaultContainer);
+ activation_controller_.reset(new ActivationController);
+ activation_controller_->set_default_container_for_test(contents_view_);
controller_.reset(new WorkspaceController(contents_view_));
}
virtual void TearDown() OVERRIDE {
+ activation_controller_.reset();
controller_.reset();
aura::test::AuraTestBase::TearDown();
}
@@ -39,7 +49,7 @@
return window;
}
- aura::Window * contents_view() {
+ aura::Window* contents_view() {
return contents_view_;
}
@@ -52,6 +62,8 @@
private:
aura::Window* contents_view_;
+ scoped_ptr<ActivationController> activation_controller_;
+
DISALLOW_COPY_AND_ASSIGN(WorkspaceControllerTest);
};
@@ -69,7 +81,7 @@
EXPECT_TRUE(ws2->AddWindowAfter(w2.get(), NULL));
// Activating a window switches the active workspace.
- w2->Activate();
+ aura_shell::ActivateWindow(w2.get());
EXPECT_EQ(ws2, workspace_manager()->GetActiveWorkspace());
// The size of contents_view() is now ws1(500) + ws2(500) + margin(50).
@@ -83,7 +95,7 @@
// Activating window w1 switches the active window and
// the mode back to normal mode.
- w1->Activate();
+ aura_shell::ActivateWindow(w1.get());
EXPECT_EQ(ws1, workspace_manager()->GetActiveWorkspace());
EXPECT_FALSE(workspace_manager()->is_overview());
« no previous file with comments | « ui/aura_shell/workspace_controller.cc ('k') | ui/views/test/views_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698