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

Side by Side Diff: ui/aura/mus/window_tree_client_unittest.cc

Issue 2535983004: Makes sure bounds and visibilty are updated correctly for new displays (Closed)
Patch Set: merge Created 4 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 unified diff | Download patch
« no previous file with comments | « ui/aura/mus/window_tree_client.cc ('k') | ui/aura/test/aura_test_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/aura/mus/window_tree_client.h" 5 #include "ui/aura/mus/window_tree_client.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 Window window1(nullptr); 1334 Window window1(nullptr);
1335 window1.Init(ui::LAYER_NOT_DRAWN); 1335 window1.Init(ui::LAYER_NOT_DRAWN);
1336 Window* window2 = new Window(nullptr); 1336 Window* window2 = new Window(nullptr);
1337 window2->Init(ui::LAYER_NOT_DRAWN); 1337 window2->Init(ui::LAYER_NOT_DRAWN);
1338 window1.AddChild(window2); 1338 window1.AddChild(window2);
1339 window_tree()->AckAllChanges(); 1339 window_tree()->AckAllChanges();
1340 window_tree_client()->OnWindowDeleted(server_id(window2)); 1340 window_tree_client()->OnWindowDeleted(server_id(window2));
1341 EXPECT_FALSE(window_tree()->has_change()); 1341 EXPECT_FALSE(window_tree()->has_change());
1342 } 1342 }
1343 1343
1344 TEST_F(WindowTreeClientWmTest, NewWindowTreeHostIsConfiguredCorrectly) {
1345 display::Display display(201);
1346 display.set_bounds(gfx::Rect(1, 2, 101, 102));
1347
1348 ui::mojom::WindowDataPtr root_data(ui::mojom::WindowData::New());
1349 root_data->parent_id = 0;
1350 root_data->window_id = 101;
1351 root_data->visible = true;
1352 root_data->bounds = display.bounds();
1353 const bool parent_drawn = true;
1354
1355 // AuraTestBase ends up owning WindowTreeHost.
1356 WindowTreeHostMus* window_tree_host =
1357 WindowTreeClientPrivate(window_tree_client_impl())
1358 .CallWmNewDisplayAdded(display, std::move(root_data), parent_drawn);
1359 EXPECT_EQ(display.bounds(), window_tree_host->GetBoundsInPixels());
1360 // The root window of the WindowTreeHost always has an origin of 0,0.
1361 EXPECT_EQ(gfx::Rect(display.bounds().size()),
1362 window_tree_host->window()->bounds());
1363 EXPECT_TRUE(window_tree_host->window()->IsVisible());
1364 EXPECT_EQ(display.id(), window_tree_host->display_id());
1365 }
1366
1344 } // namespace aura 1367 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/mus/window_tree_client.cc ('k') | ui/aura/test/aura_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698