Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/shelf/shelf_layout_manager.h" | 5 #include "ash/shelf/shelf_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
| 8 #include "ash/accelerators/accelerator_table.h" | 8 #include "ash/accelerators/accelerator_table.h" |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
| (...skipping 2307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2318 // would normally cause the ShelfLayoutManager to update its state. However | 2318 // would normally cause the ShelfLayoutManager to update its state. However |
| 2319 // during shutdown we want to handle this without crashing. | 2319 // during shutdown we want to handle this without crashing. |
| 2320 delete window1; | 2320 delete window1; |
| 2321 } | 2321 } |
| 2322 | 2322 |
| 2323 TEST_F(ShelfLayoutManagerTest, ShelfLayoutInUnifiedDesktop) { | 2323 TEST_F(ShelfLayoutManagerTest, ShelfLayoutInUnifiedDesktop) { |
| 2324 if (!SupportsMultipleDisplays()) | 2324 if (!SupportsMultipleDisplays()) |
| 2325 return; | 2325 return; |
| 2326 Shell::GetInstance()->display_manager()->SetUnifiedDesktopEnabled(true); | 2326 Shell::GetInstance()->display_manager()->SetUnifiedDesktopEnabled(true); |
| 2327 | 2327 |
| 2328 UpdateDisplay("500x500, 500x500"); | 2328 UpdateDisplay("500x400, 500x400"); |
|
James Cook
2016/04/07 15:27:09
Hooray for different width and height!
| |
| 2329 | 2329 |
| 2330 StatusAreaWidget* status_area_widget = | 2330 StatusAreaWidget* status_area_widget = |
| 2331 Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget(); | 2331 Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget(); |
| 2332 EXPECT_TRUE(status_area_widget->IsVisible()); | 2332 EXPECT_TRUE(status_area_widget->IsVisible()); |
| 2333 // Shelf should be in the first display's area. | 2333 // Shelf should be in the first display's area. |
| 2334 // TODO: make this test more robust against changes in font, font size. | 2334 gfx::Rect status_area_bounds(status_area_widget->GetWindowBoundsInScreen()); |
| 2335 EXPECT_EQ("353,453 147x47", | 2335 EXPECT_TRUE(gfx::Rect(0, 0, 500, 400).Contains(status_area_bounds)); |
| 2336 status_area_widget->GetWindowBoundsInScreen().ToString()); | 2336 EXPECT_EQ(gfx::Point(500, 400), status_area_bounds.bottom_right()); |
| 2337 } | 2337 } |
| 2338 | 2338 |
| 2339 } // namespace ash | 2339 } // namespace ash |
| OLD | NEW |