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

Unified Diff: services/ui/ws/window_manager_client_unittest.cc

Issue 2886873002: Only send the FrameSinkId to client when it is necessary (Closed)
Patch Set: Address review issues. Created 3 years, 7 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 | « services/ui/ws/test_utils.cc ('k') | services/ui/ws/window_tree.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/window_manager_client_unittest.cc
diff --git a/services/ui/ws/window_manager_client_unittest.cc b/services/ui/ws/window_manager_client_unittest.cc
index b87717d39ee8f988b167e5a356b93e3fc1c19744..9a46a98a2f925e973616638de1bf0ac04bd957bc 100644
--- a/services/ui/ws/window_manager_client_unittest.cc
+++ b/services/ui/ws/window_manager_client_unittest.cc
@@ -220,10 +220,12 @@ class WindowTracker : public aura::WindowObserver {
// Creates a new visible Window. If |parent| is non-null the newly created
// window is added to it.
-aura::Window* NewVisibleWindow(aura::Window* parent,
- aura::WindowTreeClient* client) {
+aura::Window* NewVisibleWindow(
+ aura::Window* parent,
+ aura::WindowTreeClient* client,
+ aura::WindowMusType type = aura::WindowMusType::LOCAL) {
std::unique_ptr<aura::WindowPortMus> window_port_mus =
- base::MakeUnique<aura::WindowPortMus>(client, aura::WindowMusType::LOCAL);
+ base::MakeUnique<aura::WindowPortMus>(client, type);
aura::Window* window = new aura::Window(nullptr, std::move(window_port_mus));
window->Init(ui::LAYER_NOT_DRAWN);
window->Show();
@@ -376,7 +378,8 @@ TEST_F(WindowServerTest, RootWindow) {
}
TEST_F(WindowServerTest, Embed) {
- aura::Window* window = NewVisibleWindow(GetFirstWMRoot(), window_manager());
+ aura::Window* window = NewVisibleWindow(GetFirstWMRoot(), window_manager(),
+ aura::WindowMusType::EMBED_IN_OWNER);
std::unique_ptr<EmbedResult> embed_result = Embed(window_manager(), window);
ASSERT_TRUE(embed_result->IsValid());
@@ -392,7 +395,8 @@ TEST_F(WindowServerTest, Embed) {
// Window manager has two windows, N1 and N11. Embeds A at N1. A should not see
// N11.
TEST_F(WindowServerTest, EmbeddedDoesntSeeChild) {
- aura::Window* window = NewVisibleWindow(GetFirstWMRoot(), window_manager());
+ aura::Window* window = NewVisibleWindow(GetFirstWMRoot(), window_manager(),
+ aura::WindowMusType::EMBED_IN_OWNER);
std::unique_ptr<EmbedResult> embed_result = Embed(window_manager(), window);
ASSERT_TRUE(embed_result->IsValid());
aura::Window* embed_root = embed_result->window_tree_host->window();
@@ -416,7 +420,8 @@ TEST_F(WindowServerTest, EmbeddedDoesntSeeChild) {
// Verifies that bounds changes applied to a window hierarchy in one client
// are reflected to another.
TEST_F(WindowServerTest, SetBounds) {
- aura::Window* window = NewVisibleWindow(GetFirstWMRoot(), window_manager());
+ aura::Window* window = NewVisibleWindow(GetFirstWMRoot(), window_manager(),
+ aura::WindowMusType::EMBED_IN_OWNER);
std::unique_ptr<EmbedResult> embed_result = Embed(window_manager(), window);
ASSERT_TRUE(embed_result->IsValid());
@@ -434,7 +439,8 @@ TEST_F(WindowServerTest, SetBoundsSecurity) {
TestWindowManagerDelegate wm_delegate;
set_window_manager_delegate(&wm_delegate);
- aura::Window* window = NewVisibleWindow(GetFirstWMRoot(), window_manager());
+ aura::Window* window = NewVisibleWindow(GetFirstWMRoot(), window_manager(),
+ aura::WindowMusType::EMBED_IN_OWNER);
std::unique_ptr<EmbedResult> embed_result = Embed(window_manager(), window);
ASSERT_TRUE(embed_result->IsValid());
@@ -455,7 +461,8 @@ TEST_F(WindowServerTest, SetBoundsSecurity) {
// Verifies that a root window can always be destroyed.
TEST_F(WindowServerTest, DestroySecurity) {
- aura::Window* window = NewVisibleWindow(GetFirstWMRoot(), window_manager());
+ aura::Window* window = NewVisibleWindow(GetFirstWMRoot(), window_manager(),
+ aura::WindowMusType::EMBED_IN_OWNER);
std::unique_ptr<EmbedResult> embed_result = Embed(window_manager(), window);
ASSERT_TRUE(embed_result->IsValid());
@@ -474,8 +481,10 @@ TEST_F(WindowServerTest, DestroySecurity) {
}
TEST_F(WindowServerTest, MultiRoots) {
- aura::Window* window1 = NewVisibleWindow(GetFirstWMRoot(), window_manager());
- aura::Window* window2 = NewVisibleWindow(GetFirstWMRoot(), window_manager());
+ aura::Window* window1 = NewVisibleWindow(GetFirstWMRoot(), window_manager(),
+ aura::WindowMusType::EMBED_IN_OWNER);
+ aura::Window* window2 = NewVisibleWindow(GetFirstWMRoot(), window_manager(),
+ aura::WindowMusType::EMBED_IN_OWNER);
std::unique_ptr<EmbedResult> embed_result1 = Embed(window_manager(), window1);
ASSERT_TRUE(embed_result1->IsValid());
std::unique_ptr<EmbedResult> embed_result2 = Embed(window_manager(), window2);
@@ -483,7 +492,8 @@ TEST_F(WindowServerTest, MultiRoots) {
}
TEST_F(WindowServerTest, Reorder) {
- aura::Window* window1 = NewVisibleWindow(GetFirstWMRoot(), window_manager());
+ aura::Window* window1 = NewVisibleWindow(GetFirstWMRoot(), window_manager(),
+ aura::WindowMusType::EMBED_IN_OWNER);
std::unique_ptr<EmbedResult> embed_result = Embed(window_manager(), window1);
ASSERT_TRUE(embed_result->IsValid());
@@ -560,7 +570,8 @@ class VisibilityChangeObserver : public aura::WindowObserver {
} // namespace
TEST_F(WindowServerTest, Visible) {
- aura::Window* window1 = NewVisibleWindow(GetFirstWMRoot(), window_manager());
+ aura::Window* window1 = NewVisibleWindow(GetFirstWMRoot(), window_manager(),
+ aura::WindowMusType::EMBED_IN_OWNER);
// Embed another app and verify initial state.
std::unique_ptr<EmbedResult> embed_result = Embed(window_manager(), window1);
@@ -601,7 +612,8 @@ TEST_F(WindowServerTest, Visible) {
// - verify that we see events for all windows.
TEST_F(WindowServerTest, EmbedFailsWithChildren) {
- aura::Window* window1 = NewVisibleWindow(GetFirstWMRoot(), window_manager());
+ aura::Window* window1 = NewVisibleWindow(GetFirstWMRoot(), window_manager(),
+ aura::WindowMusType::EMBED_IN_OWNER);
ASSERT_TRUE(NewVisibleWindow(window1, window_manager()));
std::unique_ptr<EmbedResult> embed_result = Embed(window_manager(), window1);
// Embed() should fail as |window1| has a child.
@@ -638,7 +650,8 @@ class DestroyObserver : public aura::WindowObserver {
// observers in the right order (OnWindowDestroyed() before
// OnWindowManagerDestroyed()).
TEST_F(WindowServerTest, WindowServerDestroyedAfterRootObserver) {
- aura::Window* window = NewVisibleWindow(GetFirstWMRoot(), window_manager());
+ aura::Window* window = NewVisibleWindow(GetFirstWMRoot(), window_manager(),
+ aura::WindowMusType::EMBED_IN_OWNER);
std::unique_ptr<EmbedResult> embed_result = Embed(window_manager(), window);
ASSERT_TRUE(embed_result->IsValid());
@@ -659,7 +672,8 @@ TEST_F(WindowServerTest, WindowServerDestroyedAfterRootObserver) {
}
TEST_F(WindowServerTest, ClientAreaChanged) {
- aura::Window* window = NewVisibleWindow(GetFirstWMRoot(), window_manager());
+ aura::Window* window = NewVisibleWindow(GetFirstWMRoot(), window_manager(),
+ aura::WindowMusType::EMBED_IN_OWNER);
std::unique_ptr<EmbedResult> embed_result = Embed(window_manager(), window);
ASSERT_TRUE(embed_result->IsValid());
@@ -698,7 +712,8 @@ class EstablishConnectionViaFactoryDelegate : public TestWindowManagerDelegate {
aura::Window* OnWmCreateTopLevelWindow(
ui::mojom::WindowType window_type,
std::map<std::string, std::vector<uint8_t>>* properties) override {
- created_window_ = NewVisibleWindow((*client_->GetRoots().begin()), client_);
+ created_window_ = NewVisibleWindow((*client_->GetRoots().begin()), client_,
+ aura::WindowMusType::TOP_LEVEL_IN_WM);
if (run_loop_)
run_loop_->Quit();
return created_window_;
« no previous file with comments | « services/ui/ws/test_utils.cc ('k') | services/ui/ws/window_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698