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

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

Issue 2726823003: Remove WmLookup. (Closed)
Patch Set: Remove wm_lookup. 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 std::unique_ptr<views::Widget> widget(CreateTestWidget()); 390 std::unique_ptr<views::Widget> widget(CreateTestWidget());
392 WmShelf* shelf = GetPrimaryShelf(); 391 WmShelf* shelf = GetPrimaryShelf();
393 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); 392 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
394 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState()); 393 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState());
395 int bottom_auto_hidden = GetPopupWorkAreaBottom(); 394 int bottom_auto_hidden = GetPopupWorkAreaBottom();
396 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); 395 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
397 396
398 // Put |widget| into fullscreen without forcing the shelf to hide. Currently, 397 // Put |widget| into fullscreen without forcing the shelf to hide. Currently,
399 // this is used by immersive fullscreen and forces the shelf to be auto 398 // this is used by immersive fullscreen and forces the shelf to be auto
400 // hidden. 399 // hidden.
401 WmLookup::Get() 400 WmWindow::Get(widget.get()->GetNativeWindow())
402 ->GetWindowForWidget(widget.get())
403 ->GetWindowState() 401 ->GetWindowState()
404 ->set_hide_shelf_when_fullscreen(false); 402 ->set_hide_shelf_when_fullscreen(false);
405 widget->SetFullscreen(true); 403 widget->SetFullscreen(true);
406 RunAllPendingInMessageLoop(); 404 RunAllPendingInMessageLoop();
407 405
408 // The work area for auto-hidden status of fullscreen is a bit larger 406 // The work area for auto-hidden status of fullscreen is a bit larger
409 // since it doesn't even have the 3-pixel width. 407 // since it doesn't even have the 3-pixel width.
410 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState()); 408 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState());
411 int bottom_fullscreen_hidden = GetPopupWorkAreaBottom(); 409 int bottom_fullscreen_hidden = GetPopupWorkAreaBottom();
412 EXPECT_EQ(bottom_auto_hidden, bottom_fullscreen_hidden); 410 EXPECT_EQ(bottom_auto_hidden, bottom_fullscreen_hidden);
(...skipping 23 matching lines...) Expand all
436 int bottom_second = GetPopupWorkAreaBottomForTray(GetSecondaryTray()); 434 int bottom_second = GetPopupWorkAreaBottomForTray(GetSecondaryTray());
437 435
438 // System tray is created on the primary display. The popups in the secondary 436 // System tray is created on the primary display. The popups in the secondary
439 // tray aren't affected. 437 // tray aren't affected.
440 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); 438 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW);
441 EXPECT_GT(bottom, GetPopupWorkAreaBottom()); 439 EXPECT_GT(bottom, GetPopupWorkAreaBottom());
442 EXPECT_EQ(bottom_second, GetPopupWorkAreaBottomForTray(GetSecondaryTray())); 440 EXPECT_EQ(bottom_second, GetPopupWorkAreaBottomForTray(GetSecondaryTray()));
443 } 441 }
444 442
445 } // namespace ash 443 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698