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

Side by Side Diff: ash/shell_unittest.cc

Issue 115113006: Rename Launcher to Shelf. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more fixes Created 7 years 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/shell/window_watcher_unittest.cc ('k') | ash/system/chromeos/audio/tray_audio.h » ('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/shell.h" 5 #include "ash/shell.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
11 #include "ash/desktop_background/desktop_background_widget_controller.h" 11 #include "ash/desktop_background/desktop_background_widget_controller.h"
12 #include "ash/display/mouse_cursor_event_filter.h" 12 #include "ash/display/mouse_cursor_event_filter.h"
13 #include "ash/drag_drop/drag_drop_controller.h" 13 #include "ash/drag_drop/drag_drop_controller.h"
14 #include "ash/launcher/launcher.h"
15 #include "ash/root_window_controller.h" 14 #include "ash/root_window_controller.h"
16 #include "ash/session_state_delegate.h" 15 #include "ash/session_state_delegate.h"
16 #include "ash/shelf/shelf.h"
17 #include "ash/shelf/shelf_layout_manager.h" 17 #include "ash/shelf/shelf_layout_manager.h"
18 #include "ash/shelf/shelf_widget.h" 18 #include "ash/shelf/shelf_widget.h"
19 #include "ash/shell_delegate.h" 19 #include "ash/shell_delegate.h"
20 #include "ash/shell_window_ids.h" 20 #include "ash/shell_window_ids.h"
21 #include "ash/test/ash_test_base.h" 21 #include "ash/test/ash_test_base.h"
22 #include "ash/test/shell_test_api.h" 22 #include "ash/test/shell_test_api.h"
23 #include "ash/wm/root_window_layout_manager.h" 23 #include "ash/wm/root_window_layout_manager.h"
24 #include "ash/wm/window_util.h" 24 #include "ash/wm/window_util.h"
25 #include "base/strings/utf_string_conversions.h" 25 #include "base/strings/utf_string_conversions.h"
26 #include "ui/aura/client/aura_constants.h" 26 #include "ui/aura/client/aura_constants.h"
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 EXPECT_EQ(views::MenuRunner::NORMAL_EXIT, 387 EXPECT_EQ(views::MenuRunner::NORMAL_EXIT,
388 menu_runner->RunMenuAt(widget, NULL, gfx::Rect(), 388 menu_runner->RunMenuAt(widget, NULL, gfx::Rect(),
389 views::MenuItemView::TOPLEFT, ui::MENU_SOURCE_MOUSE, 389 views::MenuItemView::TOPLEFT, ui::MENU_SOURCE_MOUSE,
390 views::MenuRunner::CONTEXT_MENU)); 390 views::MenuRunner::CONTEXT_MENU));
391 } 391 }
392 392
393 TEST_F(ShellTest, ManagedWindowModeBasics) { 393 TEST_F(ShellTest, ManagedWindowModeBasics) {
394 // We start with the usual window containers. 394 // We start with the usual window containers.
395 ExpectAllContainers(); 395 ExpectAllContainers();
396 // Shelf is visible. 396 // Shelf is visible.
397 ShelfWidget* launcher_widget = Launcher::ForPrimaryDisplay()->shelf_widget(); 397 ShelfWidget* shelf_widget = Shelf::ForPrimaryDisplay()->shelf_widget();
398 EXPECT_TRUE(launcher_widget->IsVisible()); 398 EXPECT_TRUE(shelf_widget->IsVisible());
399 // Shelf is at bottom-left of screen. 399 // Shelf is at bottom-left of screen.
400 EXPECT_EQ(0, launcher_widget->GetWindowBoundsInScreen().x()); 400 EXPECT_EQ(0, shelf_widget->GetWindowBoundsInScreen().x());
401 EXPECT_EQ(Shell::GetPrimaryRootWindow()->GetDispatcher()->host()-> 401 EXPECT_EQ(Shell::GetPrimaryRootWindow()->GetDispatcher()->host()->
402 GetBounds().height(), 402 GetBounds().height(),
403 launcher_widget->GetWindowBoundsInScreen().bottom()); 403 shelf_widget->GetWindowBoundsInScreen().bottom());
404 // We have a desktop background but not a bare layer. 404 // We have a desktop background but not a bare layer.
405 // TODO (antrim): enable once we find out why it fails component build. 405 // TODO (antrim): enable once we find out why it fails component build.
406 // internal::DesktopBackgroundWidgetController* background = 406 // internal::DesktopBackgroundWidgetController* background =
407 // Shell::GetPrimaryRootWindow()-> 407 // Shell::GetPrimaryRootWindow()->
408 // GetProperty(internal::kWindowDesktopComponent); 408 // GetProperty(internal::kWindowDesktopComponent);
409 // EXPECT_TRUE(background); 409 // EXPECT_TRUE(background);
410 // EXPECT_TRUE(background->widget()); 410 // EXPECT_TRUE(background->widget());
411 // EXPECT_FALSE(background->layer()); 411 // EXPECT_FALSE(background->layer());
412 412
413 // Create a normal window. It is not maximized. 413 // Create a normal window. It is not maximized.
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 private: 529 private:
530 DISALLOW_COPY_AND_ASSIGN(ShellTest2); 530 DISALLOW_COPY_AND_ASSIGN(ShellTest2);
531 }; 531 };
532 532
533 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { 533 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) {
534 window_.reset(new aura::Window(NULL)); 534 window_.reset(new aura::Window(NULL));
535 window_->Init(ui::LAYER_NOT_DRAWN); 535 window_->Init(ui::LAYER_NOT_DRAWN);
536 } 536 }
537 537
538 } // namespace ash 538 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell/window_watcher_unittest.cc ('k') | ash/system/chromeos/audio/tray_audio.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698