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

Side by Side Diff: ash/system/web_notification/web_notification_tray_unittest.cc

Issue 2726823003: Remove WmLookup. (Closed)
Patch Set: Clean up and rebase. Created 3 years, 9 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/common/system/web_notification/web_notification_tray.h" 5 #include "ash/common/system/web_notification/web_notification_tray.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/common/shelf/shelf_layout_manager.h" 10 #include "ash/common/shelf/shelf_layout_manager.h"
11 #include "ash/common/shelf/wm_shelf.h" 11 #include "ash/common/shelf/wm_shelf.h"
12 #include "ash/common/system/status_area_widget.h" 12 #include "ash/common/system/status_area_widget.h"
13 #include "ash/common/system/tray/system_tray.h" 13 #include "ash/common/system/tray/system_tray.h"
14 #include "ash/common/system/tray/system_tray_item.h" 14 #include "ash/common/system/tray/system_tray_item.h"
15 #include "ash/common/system/web_notification/ash_popup_alignment_delegate.h" 15 #include "ash/common/system/web_notification/ash_popup_alignment_delegate.h"
16 #include "ash/common/test/test_system_tray_delegate.h" 16 #include "ash/common/test/test_system_tray_delegate.h"
17 #include "ash/common/wm/window_state.h" 17 #include "ash/common/wm/window_state.h"
18 #include "ash/common/wm_lookup.h"
19 #include "ash/common/wm_window.h" 18 #include "ash/common/wm_window.h"
20 #include "ash/public/cpp/shell_window_ids.h" 19 #include "ash/public/cpp/shell_window_ids.h"
21 #include "ash/shell.h" 20 #include "ash/shell.h"
22 #include "ash/system/chromeos/screen_layout_observer.h" 21 #include "ash/system/chromeos/screen_layout_observer.h"
23 #include "ash/test/ash_test_base.h" 22 #include "ash/test/ash_test_base.h"
24 #include "ash/test/status_area_widget_test_helper.h" 23 #include "ash/test/status_area_widget_test_helper.h"
25 #include "base/memory/ptr_util.h" 24 #include "base/memory/ptr_util.h"
26 #include "base/strings/stringprintf.h" 25 #include "base/strings/stringprintf.h"
27 #include "base/strings/utf_string_conversions.h" 26 #include "base/strings/utf_string_conversions.h"
28 #include "ui/display/display.h" 27 #include "ui/display/display.h"
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 std::unique_ptr<views::Widget> widget(CreateTestWidget()); 342 std::unique_ptr<views::Widget> widget(CreateTestWidget());
344 WmShelf* shelf = GetPrimaryShelf(); 343 WmShelf* shelf = GetPrimaryShelf();
345 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); 344 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
346 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState()); 345 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState());
347 int bottom_auto_hidden = GetPopupWorkAreaBottom(); 346 int bottom_auto_hidden = GetPopupWorkAreaBottom();
348 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); 347 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
349 348
350 // Put |widget| into fullscreen without forcing the shelf to hide. Currently, 349 // Put |widget| into fullscreen without forcing the shelf to hide. Currently,
351 // this is used by immersive fullscreen and forces the shelf to be auto 350 // this is used by immersive fullscreen and forces the shelf to be auto
352 // hidden. 351 // hidden.
353 WmLookup::Get() 352 WmWindow::Get(widget->GetNativeWindow())
354 ->GetWindowForWidget(widget.get())
355 ->GetWindowState() 353 ->GetWindowState()
356 ->set_hide_shelf_when_fullscreen(false); 354 ->set_hide_shelf_when_fullscreen(false);
357 widget->SetFullscreen(true); 355 widget->SetFullscreen(true);
358 RunAllPendingInMessageLoop(); 356 RunAllPendingInMessageLoop();
359 357
360 // The work area for auto-hidden status of fullscreen is a bit larger 358 // The work area for auto-hidden status of fullscreen is a bit larger
361 // since it doesn't even have the 3-pixel width. 359 // since it doesn't even have the 3-pixel width.
362 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState()); 360 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState());
363 int bottom_fullscreen_hidden = GetPopupWorkAreaBottom(); 361 int bottom_fullscreen_hidden = GetPopupWorkAreaBottom();
364 EXPECT_EQ(bottom_auto_hidden, bottom_fullscreen_hidden); 362 EXPECT_EQ(bottom_auto_hidden, bottom_fullscreen_hidden);
(...skipping 23 matching lines...) Expand all
388 int bottom_second = GetPopupWorkAreaBottomForTray(GetSecondaryTray()); 386 int bottom_second = GetPopupWorkAreaBottomForTray(GetSecondaryTray());
389 387
390 // System tray is created on the primary display. The popups in the secondary 388 // System tray is created on the primary display. The popups in the secondary
391 // tray aren't affected. 389 // tray aren't affected.
392 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); 390 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW);
393 EXPECT_GT(bottom, GetPopupWorkAreaBottom()); 391 EXPECT_GT(bottom, GetPopupWorkAreaBottom());
394 EXPECT_EQ(bottom_second, GetPopupWorkAreaBottomForTray(GetSecondaryTray())); 392 EXPECT_EQ(bottom_second, GetPopupWorkAreaBottomForTray(GetSecondaryTray()));
395 } 393 }
396 394
397 } // namespace ash 395 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698