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

Unified Diff: components/mus/ws/focus_controller_unittest.cc

Issue 1459463004: mus: Allow the WM to specify the windows that can have active children. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot-merge Created 5 years, 1 month 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 | « components/mus/ws/focus_controller_observer.h ('k') | components/mus/ws/window_manager_client_apptest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/focus_controller_unittest.cc
diff --git a/components/mus/ws/focus_controller_unittest.cc b/components/mus/ws/focus_controller_unittest.cc
index 7e9cdf800e4534583bcfe610209b415adba51d2d..fc86877e77f6c000762acd2896b0d6564bb44b5f 100644
--- a/components/mus/ws/focus_controller_unittest.cc
+++ b/components/mus/ws/focus_controller_unittest.cc
@@ -4,6 +4,7 @@
#include "components/mus/ws/focus_controller.h"
+#include "components/mus/ws/focus_controller_delegate.h"
#include "components/mus/ws/focus_controller_observer.h"
#include "components/mus/ws/server_window.h"
#include "components/mus/ws/test_server_window_delegate.h"
@@ -14,7 +15,8 @@ namespace mus {
namespace ws {
namespace {
-class TestFocusControllerObserver : public FocusControllerObserver {
+class TestFocusControllerObserver : public FocusControllerObserver,
+ public FocusControllerDelegate {
public:
TestFocusControllerObserver()
: change_count_(0u),
@@ -31,7 +33,13 @@ class TestFocusControllerObserver : public FocusControllerObserver {
ServerWindow* new_focused_window() { return new_focused_window_; }
private:
+ // FocusControllerDelegate:
+ bool CanHaveActiveChildren(ServerWindow* window) const override {
+ return true;
+ }
// FocusControllerObserver:
+ void OnActivationChanged(ServerWindow* old_active_window,
+ ServerWindow* new_active_window) override {}
void OnFocusChanged(FocusControllerChangeSource source,
ServerWindow* old_focused_window,
ServerWindow* new_focused_window) override {
@@ -65,7 +73,7 @@ TEST(FocusControllerTest, Basic) {
child.Add(&child_child);
TestFocusControllerObserver focus_observer;
- FocusController focus_controller;
+ FocusController focus_controller(&focus_observer);
focus_controller.AddObserver(&focus_observer);
focus_controller.SetFocusedWindow(&child_child);
« no previous file with comments | « components/mus/ws/focus_controller_observer.h ('k') | components/mus/ws/window_manager_client_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698