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

Unified Diff: ui/aura/test/aura_test_helper.cc

Issue 2714763002: Change FocusSynchronizer to maintain active focus client and window. (Closed)
Patch Set: test Created 3 years, 9 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
« no previous file with comments | « ui/aura/mus/window_tree_client_unittest.cc ('k') | ui/views/mus/desktop_window_tree_host_mus.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/test/aura_test_helper.cc
diff --git a/ui/aura/test/aura_test_helper.cc b/ui/aura/test/aura_test_helper.cc
index ccbd85342fa274db54259999d02b6655d95d30ec..25ffb484f1c7026df7258607e8c39d6ca42aa2f2 100644
--- a/ui/aura/test/aura_test_helper.cc
+++ b/ui/aura/test/aura_test_helper.cc
@@ -12,6 +12,7 @@
#include "ui/aura/env.h"
#include "ui/aura/input_state_lookup.h"
#include "ui/aura/mus/capture_synchronizer.h"
+#include "ui/aura/mus/focus_synchronizer.h"
#include "ui/aura/mus/window_port_mus.h"
#include "ui/aura/mus/window_tree_client.h"
#include "ui/aura/test/env_test_helper.h"
@@ -112,7 +113,6 @@ void AuraTestHelper::SetUp(ui::ContextFactory* context_factory,
// Tests assume they can set the mouse location on Env() and have it reflected
// in tests.
env_helper.SetAlwaysUseLastMouseLocation(true);
- Env::GetInstance()->SetActiveFocusClient(focus_client_.get(), nullptr);
Env::GetInstance()->set_context_factory(context_factory);
Env::GetInstance()->set_context_factory_private(context_factory_private);
// Unit tests generally don't want to query the system, rather use the state
@@ -141,8 +141,11 @@ void AuraTestHelper::SetUp(ui::ContextFactory* context_factory,
// Ensure width != height so tests won't confuse them.
host()->SetBoundsInPixels(gfx::Rect(host_size));
- if (mode_ == Mode::MUS_CREATE_WINDOW_TREE_CLIENT)
+ if (mode_ == Mode::MUS_CREATE_WINDOW_TREE_CLIENT) {
+ window_tree_client_->focus_synchronizer()->SetActiveFocusClient(
+ focus_client_.get(), root_window());
window_tree()->AckAllChanges();
+ }
g_instance = this;
}
@@ -159,7 +162,6 @@ void AuraTestHelper::TearDown() {
display::Screen::SetScreenInstance(nullptr);
test_screen_.reset();
- Env::GetInstance()->SetActiveFocusClient(nullptr, nullptr);
window_tree_client_setup_.reset();
focus_client_.reset();
capture_client_.reset();
« no previous file with comments | « ui/aura/mus/window_tree_client_unittest.cc ('k') | ui/views/mus/desktop_window_tree_host_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698