| OLD | NEW |
| 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" |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 new views::MenuRunner(menu_model.get())); | 373 new views::MenuRunner(menu_model.get())); |
| 374 | 374 |
| 375 // When MenuRunner runs a nested loop the LockScreenAndVerifyMenuClosed | 375 // When MenuRunner runs a nested loop the LockScreenAndVerifyMenuClosed |
| 376 // command will fire, check the menu state and ensure the nested menu loop | 376 // command will fire, check the menu state and ensure the nested menu loop |
| 377 // is exited so that the test will terminate. | 377 // is exited so that the test will terminate. |
| 378 base::MessageLoopForUI::current()->PostTask(FROM_HERE, | 378 base::MessageLoopForUI::current()->PostTask(FROM_HERE, |
| 379 base::Bind(&ShellTest::LockScreenAndVerifyMenuClosed, | 379 base::Bind(&ShellTest::LockScreenAndVerifyMenuClosed, |
| 380 base::Unretained(this))); | 380 base::Unretained(this))); |
| 381 | 381 |
| 382 EXPECT_EQ(views::MenuRunner::NORMAL_EXIT, | 382 EXPECT_EQ(views::MenuRunner::NORMAL_EXIT, |
| 383 menu_runner->RunMenuAt(widget, NULL, gfx::Rect(), | 383 menu_runner->RunMenuAt(widget, |
| 384 views::MenuItemView::TOPLEFT, ui::MENU_SOURCE_MOUSE, | 384 NULL, |
| 385 views::MenuRunner::CONTEXT_MENU)); | 385 gfx::Rect(), |
| 386 views::MENU_ANCHOR_TOPLEFT, |
| 387 ui::MENU_SOURCE_MOUSE, |
| 388 views::MenuRunner::CONTEXT_MENU)); |
| 386 } | 389 } |
| 387 | 390 |
| 388 TEST_F(ShellTest, ManagedWindowModeBasics) { | 391 TEST_F(ShellTest, ManagedWindowModeBasics) { |
| 389 // We start with the usual window containers. | 392 // We start with the usual window containers. |
| 390 ExpectAllContainers(); | 393 ExpectAllContainers(); |
| 391 // Shelf is visible. | 394 // Shelf is visible. |
| 392 ShelfWidget* shelf_widget = Shelf::ForPrimaryDisplay()->shelf_widget(); | 395 ShelfWidget* shelf_widget = Shelf::ForPrimaryDisplay()->shelf_widget(); |
| 393 EXPECT_TRUE(shelf_widget->IsVisible()); | 396 EXPECT_TRUE(shelf_widget->IsVisible()); |
| 394 // Shelf is at bottom-left of screen. | 397 // Shelf is at bottom-left of screen. |
| 395 EXPECT_EQ(0, shelf_widget->GetWindowBoundsInScreen().x()); | 398 EXPECT_EQ(0, shelf_widget->GetWindowBoundsInScreen().x()); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 private: | 534 private: |
| 532 DISALLOW_COPY_AND_ASSIGN(ShellTest2); | 535 DISALLOW_COPY_AND_ASSIGN(ShellTest2); |
| 533 }; | 536 }; |
| 534 | 537 |
| 535 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { | 538 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { |
| 536 window_.reset(new aura::Window(NULL)); | 539 window_.reset(new aura::Window(NULL)); |
| 537 window_->Init(aura::WINDOW_LAYER_NOT_DRAWN); | 540 window_->Init(aura::WINDOW_LAYER_NOT_DRAWN); |
| 538 } | 541 } |
| 539 | 542 |
| 540 } // namespace ash | 543 } // namespace ash |
| OLD | NEW |