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.h" |
5 #include "ash/shelf/shelf_layout_manager.h" | 6 #include "ash/shelf/shelf_layout_manager.h" |
6 #include "ash/shelf/wm_shelf.h" | |
7 #include "ash/wm_window.h" | 7 #include "ash/wm_window.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
11 #include "chrome/browser/ui/browser_window.h" | 11 #include "chrome/browser/ui/browser_window.h" |
12 #include "chrome/browser/ui/status_bubble.h" | 12 #include "chrome/browser/ui/status_bubble.h" |
13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
14 #include "chrome/test/base/in_process_browser_test.h" | 14 #include "chrome/test/base/in_process_browser_test.h" |
15 #include "chromeos/chromeos_switches.h" | 15 #include "chromeos/chromeos_switches.h" |
16 #include "components/user_manager/user_names.h" | 16 #include "components/user_manager/user_names.h" |
17 | 17 |
18 using ShelfBrowserTest = InProcessBrowserTest; | 18 using ShelfBrowserTest = InProcessBrowserTest; |
19 | 19 |
20 // Confirm that a status bubble doesn't cause the shelf to darken. | 20 // Confirm that a status bubble doesn't cause the shelf to darken. |
21 IN_PROC_BROWSER_TEST_F(ShelfBrowserTest, StatusBubble) { | 21 IN_PROC_BROWSER_TEST_F(ShelfBrowserTest, StatusBubble) { |
22 ash::ShelfLayoutManager* shelf_layout_manager = | 22 ash::ShelfLayoutManager* shelf_layout_manager = |
23 ash::WmShelf::ForWindow(browser()->window()->GetNativeWindow()) | 23 ash::Shelf::ForWindow(browser()->window()->GetNativeWindow()) |
24 ->shelf_layout_manager(); | 24 ->shelf_layout_manager(); |
25 EXPECT_TRUE(shelf_layout_manager->IsVisible()); | 25 EXPECT_TRUE(shelf_layout_manager->IsVisible()); |
26 | 26 |
27 // Ensure that the browser abuts the shelf. | 27 // Ensure that the browser abuts the shelf. |
28 gfx::Rect bounds = browser()->window()->GetBounds(); | 28 gfx::Rect bounds = browser()->window()->GetBounds(); |
29 bounds.set_height(shelf_layout_manager->GetIdealBounds().y() - bounds.y()); | 29 bounds.set_height(shelf_layout_manager->GetIdealBounds().y() - bounds.y()); |
30 browser()->window()->SetBounds(bounds); | 30 browser()->window()->SetBounds(bounds); |
31 EXPECT_FALSE(shelf_layout_manager->window_overlaps_shelf()); | 31 EXPECT_FALSE(shelf_layout_manager->window_overlaps_shelf()); |
32 | 32 |
33 // Show status, which may overlap the shelf by a pixel. | 33 // Show status, which may overlap the shelf by a pixel. |
(...skipping 18 matching lines...) Expand all Loading... |
52 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "hash"); | 52 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "hash"); |
53 command_line->AppendSwitchASCII( | 53 command_line->AppendSwitchASCII( |
54 chromeos::switches::kLoginUser, | 54 chromeos::switches::kLoginUser, |
55 user_manager::GuestAccountId().GetUserEmail()); | 55 user_manager::GuestAccountId().GetUserEmail()); |
56 } | 56 } |
57 }; | 57 }; |
58 | 58 |
59 // Tests that in guest session, shelf alignment could be initialized to bottom | 59 // Tests that in guest session, shelf alignment could be initialized to bottom |
60 // aligned, instead of bottom locked (crbug.com/699661). | 60 // aligned, instead of bottom locked (crbug.com/699661). |
61 IN_PROC_BROWSER_TEST_F(ShelfGuestSessionBrowserTest, ShelfAlignment) { | 61 IN_PROC_BROWSER_TEST_F(ShelfGuestSessionBrowserTest, ShelfAlignment) { |
62 ash::WmShelf* shelf = | 62 ash::Shelf* shelf = |
63 ash::WmShelf::ForWindow(browser()->window()->GetNativeWindow()); | 63 ash::Shelf::ForWindow(browser()->window()->GetNativeWindow()); |
64 EXPECT_EQ(ash::SHELF_ALIGNMENT_BOTTOM, shelf->alignment()); | 64 EXPECT_EQ(ash::SHELF_ALIGNMENT_BOTTOM, shelf->alignment()); |
65 } | 65 } |
OLD | NEW |