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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 base::MessageLoopForUI::current()->PostTask(FROM_HERE, | 379 base::MessageLoopForUI::current()->PostTask(FROM_HERE, |
380 base::Bind(&ShellTest::LockScreenAndVerifyMenuClosed, | 380 base::Bind(&ShellTest::LockScreenAndVerifyMenuClosed, |
381 base::Unretained(this))); | 381 base::Unretained(this))); |
382 | 382 |
383 EXPECT_EQ(views::MenuRunner::NORMAL_EXIT, | 383 EXPECT_EQ(views::MenuRunner::NORMAL_EXIT, |
384 menu_runner->RunMenuAt(widget, NULL, gfx::Rect(), | 384 menu_runner->RunMenuAt(widget, NULL, gfx::Rect(), |
385 views::MenuItemView::TOPLEFT, ui::MENU_SOURCE_MOUSE, | 385 views::MenuItemView::TOPLEFT, ui::MENU_SOURCE_MOUSE, |
386 views::MenuRunner::CONTEXT_MENU)); | 386 views::MenuRunner::CONTEXT_MENU)); |
387 } | 387 } |
388 | 388 |
389 // Fails on Mac, see http://crbug.com/115662 | 389 TEST_F(ShellTest, ManagedWindowModeBasics) { |
390 #if defined(OS_MACOSX) | |
391 #define MAYBE_ManagedWindowModeBasics DISABLED_ManagedWindowModeBasics | |
392 #else | |
393 #define MAYBE_ManagedWindowModeBasics ManagedWindowModeBasics | |
394 #endif | |
395 TEST_F(ShellTest, MAYBE_ManagedWindowModeBasics) { | |
396 Shell* shell = Shell::GetInstance(); | 390 Shell* shell = Shell::GetInstance(); |
397 Shell::TestApi test_api(shell); | 391 Shell::TestApi test_api(shell); |
398 | 392 |
399 // We start with the usual window containers. | 393 // We start with the usual window containers. |
400 ExpectAllContainers(); | 394 ExpectAllContainers(); |
401 // Launcher is visible. | 395 // Launcher is visible. |
402 ShelfWidget* launcher_widget = Launcher::ForPrimaryDisplay()->shelf_widget(); | 396 ShelfWidget* launcher_widget = Launcher::ForPrimaryDisplay()->shelf_widget(); |
403 EXPECT_TRUE(launcher_widget->IsVisible()); | 397 EXPECT_TRUE(launcher_widget->IsVisible()); |
404 // Launcher is at bottom-left of screen. | 398 // Launcher is at bottom-left of screen. |
405 EXPECT_EQ(0, launcher_widget->GetWindowBoundsInScreen().x()); | 399 EXPECT_EQ(0, launcher_widget->GetWindowBoundsInScreen().x()); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 private: | 532 private: |
539 DISALLOW_COPY_AND_ASSIGN(ShellTest2); | 533 DISALLOW_COPY_AND_ASSIGN(ShellTest2); |
540 }; | 534 }; |
541 | 535 |
542 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { | 536 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { |
543 window_.reset(new aura::Window(NULL)); | 537 window_.reset(new aura::Window(NULL)); |
544 window_->Init(ui::LAYER_NOT_DRAWN); | 538 window_->Init(ui::LAYER_NOT_DRAWN); |
545 } | 539 } |
546 | 540 |
547 } // namespace ash | 541 } // namespace ash |
OLD | NEW |