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

Side by Side Diff: ash/shell_unittest.cc

Issue 2790773002: Cleanup MenuRunner API (Closed)
Patch Set: Rebase Created 3 years, 8 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/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/display/mouse_cursor_event_filter.h" 10 #include "ash/display/mouse_cursor_event_filter.h"
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 TEST_F(ShellTest, LockScreenClosesActiveMenu) { 350 TEST_F(ShellTest, LockScreenClosesActiveMenu) {
351 SimpleMenuDelegate menu_delegate; 351 SimpleMenuDelegate menu_delegate;
352 std::unique_ptr<ui::SimpleMenuModel> menu_model( 352 std::unique_ptr<ui::SimpleMenuModel> menu_model(
353 new ui::SimpleMenuModel(&menu_delegate)); 353 new ui::SimpleMenuModel(&menu_delegate));
354 menu_model->AddItem(0, base::ASCIIToUTF16("Menu item")); 354 menu_model->AddItem(0, base::ASCIIToUTF16("Menu item"));
355 views::Widget* widget = ShellPort::Get() 355 views::Widget* widget = ShellPort::Get()
356 ->GetPrimaryRootWindow() 356 ->GetPrimaryRootWindow()
357 ->GetRootWindowController() 357 ->GetRootWindowController()
358 ->wallpaper_widget_controller() 358 ->wallpaper_widget_controller()
359 ->widget(); 359 ->widget();
360 std::unique_ptr<views::MenuRunner> menu_runner(new views::MenuRunner( 360 std::unique_ptr<views::MenuRunner> menu_runner(
361 menu_model.get(), 361 new views::MenuRunner(menu_model.get(), views::MenuRunner::CONTEXT_MENU));
362 views::MenuRunner::CONTEXT_MENU | views::MenuRunner::ASYNC));
363 362
364 EXPECT_EQ(views::MenuRunner::NORMAL_EXIT, 363 menu_runner->RunMenuAt(widget, NULL, gfx::Rect(), views::MENU_ANCHOR_TOPLEFT,
365 menu_runner->RunMenuAt(widget, NULL, gfx::Rect(), 364 ui::MENU_SOURCE_MOUSE);
366 views::MENU_ANCHOR_TOPLEFT,
367 ui::MENU_SOURCE_MOUSE));
368 LockScreenAndVerifyMenuClosed(); 365 LockScreenAndVerifyMenuClosed();
369 } 366 }
370 367
371 TEST_F(ShellTest, ManagedWindowModeBasics) { 368 TEST_F(ShellTest, ManagedWindowModeBasics) {
372 // We start with the usual window containers. 369 // We start with the usual window containers.
373 ExpectAllContainers(); 370 ExpectAllContainers();
374 // Shelf is visible. 371 // Shelf is visible.
375 ShelfWidget* shelf_widget = GetPrimaryShelf()->shelf_widget(); 372 ShelfWidget* shelf_widget = GetPrimaryShelf()->shelf_widget();
376 EXPECT_TRUE(shelf_widget->IsVisible()); 373 EXPECT_TRUE(shelf_widget->IsVisible());
377 // Shelf is at bottom-left of screen. 374 // Shelf is at bottom-left of screen.
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 // the case with classic-ash where embedders can separately create 513 // the case with classic-ash where embedders can separately create
517 // aura::Windows. 514 // aura::Windows.
518 if (Shell::GetAshConfig() == Config::MASH) 515 if (Shell::GetAshConfig() == Config::MASH)
519 return; 516 return;
520 517
521 window_.reset(new aura::Window(NULL)); 518 window_.reset(new aura::Window(NULL));
522 window_->Init(ui::LAYER_NOT_DRAWN); 519 window_->Init(ui::LAYER_NOT_DRAWN);
523 } 520 }
524 521
525 } // namespace ash 522 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell/window_type_launcher.cc ('k') | chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698