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

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

Issue 32943006: [Refactor] Replace kFullscreenUsesMinimalChromeKey with WindowState::hide_shelf_when_fullscreen() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « ash/shelf/shelf_layout_manager_unittest.cc ('k') | ash/wm/gestures/shelf_gesture_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/system/web_notification/web_notification_tray.h" 5 #include "ash/system/web_notification/web_notification_tray.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/display/display_manager.h" 9 #include "ash/display/display_manager.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
11 #include "ash/shelf/shelf_layout_manager.h" 11 #include "ash/shelf/shelf_layout_manager.h"
12 #include "ash/shelf/shelf_widget.h" 12 #include "ash/shelf/shelf_widget.h"
13 #include "ash/shell.h" 13 #include "ash/shell.h"
14 #include "ash/system/status_area_widget.h" 14 #include "ash/system/status_area_widget.h"
15 #include "ash/system/tray/system_tray.h" 15 #include "ash/system/tray/system_tray.h"
16 #include "ash/system/tray/system_tray_item.h" 16 #include "ash/system/tray/system_tray_item.h"
17 #include "ash/test/ash_test_base.h" 17 #include "ash/test/ash_test_base.h"
18 #include "ash/test/test_system_tray_delegate.h" 18 #include "ash/test/test_system_tray_delegate.h"
19 #include "ash/wm/window_properties.h" 19 #include "ash/wm/window_state.h"
20 #include "base/strings/stringprintf.h" 20 #include "base/strings/stringprintf.h"
21 #include "base/strings/utf_string_conversions.h" 21 #include "base/strings/utf_string_conversions.h"
22 #include "ui/aura/client/aura_constants.h" 22 #include "ui/aura/client/aura_constants.h"
23 #include "ui/aura/test/event_generator.h" 23 #include "ui/aura/test/event_generator.h"
24 #include "ui/aura/window.h" 24 #include "ui/aura/window.h"
25 #include "ui/gfx/display.h" 25 #include "ui/gfx/display.h"
26 #include "ui/gfx/screen.h" 26 #include "ui/gfx/screen.h"
27 #include "ui/message_center/message_center_style.h" 27 #include "ui/message_center/message_center_style.h"
28 #include "ui/message_center/message_center_tray.h" 28 #include "ui/message_center/message_center_tray.h"
29 #include "ui/message_center/message_center_util.h" 29 #include "ui/message_center/message_center_util.h"
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 // Checks the work area for normal auto-hidden state. 422 // Checks the work area for normal auto-hidden state.
423 scoped_ptr<aura::Window> window( 423 scoped_ptr<aura::Window> window(
424 CreateTestWindowInShellWithBounds(gfx::Rect(1, 2, 3, 4))); 424 CreateTestWindowInShellWithBounds(gfx::Rect(1, 2, 3, 4)));
425 internal::ShelfLayoutManager* shelf = 425 internal::ShelfLayoutManager* shelf =
426 Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager(); 426 Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager();
427 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); 427 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
428 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); 428 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
429 gfx::Rect work_area_auto_hidden = GetPopupWorkArea(); 429 gfx::Rect work_area_auto_hidden = GetPopupWorkArea();
430 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); 430 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
431 431
432 // Make the window to use immersive mode. 432 // Put |window| into fullscreen without forcing the shelf to hide. Currently,
433 window->SetProperty(internal::kFullscreenUsesMinimalChromeKey, true); 433 // this is used by immersive fullscreen and forces the shelf to be auto
434 // hidden.
435 wm::GetWindowState(window.get())->set_hide_shelf_when_fullscreen(false);
434 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); 436 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
435 RunAllPendingInMessageLoop(); 437 RunAllPendingInMessageLoop();
436 438
437 // The work area for auto-hidden status of fullscreen is a bit larger 439 // The work area for auto-hidden status of fullscreen is a bit larger
438 // since it doesn't even have the 3-pixel width. 440 // since it doesn't even have the 3-pixel width.
439 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); 441 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
440 gfx::Rect work_area_fullscreen_hidden = GetPopupWorkArea(); 442 gfx::Rect work_area_fullscreen_hidden = GetPopupWorkArea();
441 EXPECT_EQ(work_area_auto_hidden.ToString(), 443 EXPECT_EQ(work_area_auto_hidden.ToString(),
442 work_area_fullscreen_hidden.ToString()); 444 work_area_fullscreen_hidden.ToString());
443 445
(...skipping 22 matching lines...) Expand all
466 468
467 // System tray is created on the primary display. The popups in the secondary 469 // System tray is created on the primary display. The popups in the secondary
468 // tray aren't affected. 470 // tray aren't affected.
469 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); 471 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW);
470 EXPECT_GT(work_area.size().GetArea(), GetPopupWorkArea().size().GetArea()); 472 EXPECT_GT(work_area.size().GetArea(), GetPopupWorkArea().size().GetArea());
471 EXPECT_EQ(work_area_second.ToString(), 473 EXPECT_EQ(work_area_second.ToString(),
472 GetPopupWorkAreaForTray(GetSecondaryTray()).ToString()); 474 GetPopupWorkAreaForTray(GetSecondaryTray()).ToString());
473 } 475 }
474 476
475 } // namespace ash 477 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_layout_manager_unittest.cc ('k') | ash/wm/gestures/shelf_gesture_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698