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

Side by Side Diff: athena/wm/window_manager_unittest.cc

Issue 465803002: Make the minimized home card not overlap activities on Athena (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "athena/wm/public/window_manager.h" 5 #include "athena/wm/public/window_manager.h"
6 6
7 #include "athena/screen/public/screen_manager.h"
7 #include "athena/test/athena_test_base.h" 8 #include "athena/test/athena_test_base.h"
9 #include "ui/aura/client/window_tree_client.h"
10 #include "ui/aura/window.h"
11 #include "ui/gfx/display.h"
12 #include "ui/gfx/insets.h"
13 #include "ui/gfx/screen.h"
8 14
9 typedef athena::test::AthenaTestBase WindowManagerTest; 15 namespace athena {
16
17 typedef test::AthenaTestBase WindowManagerTest;
10 18
11 TEST_F(WindowManagerTest, Empty) { 19 TEST_F(WindowManagerTest, Empty) {
12 } 20 }
21
22 // Verifies that activities are created with the work area bounds.
23 TEST_F(WindowManagerTest, NewActivityBounds) {
24 gfx::Insets work_area_insets(1, 2, 3, 4);
25 ScreenManager::Get()->SetWorkAreaInsets(work_area_insets);
26
27 aura::Window* window = new aura::Window(NULL);
28 window->SetType(ui::wm::WINDOW_TYPE_NORMAL);
29 window->Init(aura::WINDOW_LAYER_TEXTURED);
30 aura::client::ParentWindowWithContext(
31 window, ScreenManager::Get()->GetContext(), gfx::Rect());
32 window->Show();
33
34 gfx::Display display = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay();
35 gfx::Rect expected_work_area_bounds = display.bounds();
36 expected_work_area_bounds.Inset(work_area_insets);
37 EXPECT_EQ(expected_work_area_bounds.ToString(),
38 display.work_area().ToString());
39 EXPECT_EQ(expected_work_area_bounds.ToString(),
40 window->GetBoundsInScreen().ToString());
41 }
42
43 } // namespace athena
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698