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

Side by Side Diff: chrome/browser/ui/ash/shelf_browsertest.cc

Issue 2237903003: mash: Migrate Shelf aura::Window uses to WmWindow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move shelf notify functions to WmShell. Created 4 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
OLDNEW
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/aura/wm_window_aura.h"
5 #include "ash/shelf/shelf.h" 6 #include "ash/shelf/shelf.h"
6 #include "ash/shelf/shelf_layout_manager.h" 7 #include "ash/shelf/shelf_layout_manager.h"
7 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_window.h" 10 #include "chrome/browser/ui/browser_window.h"
10 #include "chrome/browser/ui/status_bubble.h" 11 #include "chrome/browser/ui/status_bubble.h"
11 #include "chrome/test/base/in_process_browser_test.h" 12 #include "chrome/test/base/in_process_browser_test.h"
12 13
13 typedef InProcessBrowserTest ShelfBrowserTest; 14 typedef InProcessBrowserTest ShelfBrowserTest;
14 15
15 // Confirm that a status bubble doesn't cause the shelf to darken. 16 // Confirm that a status bubble doesn't cause the shelf to darken.
16 IN_PROC_BROWSER_TEST_F(ShelfBrowserTest, StatusBubble) { 17 IN_PROC_BROWSER_TEST_F(ShelfBrowserTest, StatusBubble) {
17 ash::ShelfLayoutManager* shelf_layout_manager = 18 ash::ShelfLayoutManager* shelf_layout_manager =
18 ash::Shelf::ForWindow(browser()->window()->GetNativeWindow()) 19 ash::Shelf::ForWindow(
20 ash::WmWindowAura::Get(browser()->window()->GetNativeWindow()))
19 ->shelf_layout_manager(); 21 ->shelf_layout_manager();
20 EXPECT_TRUE(shelf_layout_manager->IsVisible()); 22 EXPECT_TRUE(shelf_layout_manager->IsVisible());
21 23
22 // Ensure that the browser abuts the shelf. 24 // Ensure that the browser abuts the shelf.
23 gfx::Rect bounds = browser()->window()->GetBounds(); 25 gfx::Rect bounds = browser()->window()->GetBounds();
24 bounds.set_height(shelf_layout_manager->GetIdealBounds().y() - bounds.y()); 26 bounds.set_height(shelf_layout_manager->GetIdealBounds().y() - bounds.y());
25 browser()->window()->SetBounds(bounds); 27 browser()->window()->SetBounds(bounds);
26 EXPECT_FALSE(shelf_layout_manager->window_overlaps_shelf()); 28 EXPECT_FALSE(shelf_layout_manager->window_overlaps_shelf());
27 29
28 // Show status, which may overlap the shelf by a pixel. 30 // Show status, which may overlap the shelf by a pixel.
29 browser()->window()->GetStatusBubble()->SetStatus( 31 browser()->window()->GetStatusBubble()->SetStatus(
30 base::UTF8ToUTF16("Dummy Status Text")); 32 base::UTF8ToUTF16("Dummy Status Text"));
31 shelf_layout_manager->UpdateVisibilityState(); 33 shelf_layout_manager->UpdateVisibilityState();
32 34
33 // Ensure that status doesn't cause overlap. 35 // Ensure that status doesn't cause overlap.
34 EXPECT_FALSE(shelf_layout_manager->window_overlaps_shelf()); 36 EXPECT_FALSE(shelf_layout_manager->window_overlaps_shelf());
35 37
36 // Ensure that moving the browser slightly down does cause overlap. 38 // Ensure that moving the browser slightly down does cause overlap.
37 bounds.Offset(0, 1); 39 bounds.Offset(0, 1);
38 browser()->window()->SetBounds(bounds); 40 browser()->window()->SetBounds(bounds);
39 EXPECT_TRUE(shelf_layout_manager->window_overlaps_shelf()); 41 EXPECT_TRUE(shelf_layout_manager->window_overlaps_shelf());
40 } 42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698