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

Side by Side Diff: ash/shell_unittest.cc

Issue 2815043002: Removes ShellPort::IsRunningInMash() (Closed)
Patch Set: dont set instance_ in constructor 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
« no previous file with comments | « ash/shell_port.h ('k') | ash/sticky_keys/sticky_keys_overlay_unittest.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/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"
11 #include "ash/drag_drop/drag_drop_controller.h" 11 #include "ash/drag_drop/drag_drop_controller.h"
12 #include "ash/public/cpp/config.h"
12 #include "ash/public/cpp/shell_window_ids.h" 13 #include "ash/public/cpp/shell_window_ids.h"
13 #include "ash/root_window_controller.h" 14 #include "ash/root_window_controller.h"
14 #include "ash/session/session_controller.h" 15 #include "ash/session/session_controller.h"
15 #include "ash/shelf/shelf_layout_manager.h" 16 #include "ash/shelf/shelf_layout_manager.h"
16 #include "ash/shelf/shelf_widget.h" 17 #include "ash/shelf/shelf_widget.h"
17 #include "ash/shelf/wm_shelf.h" 18 #include "ash/shelf/wm_shelf.h"
18 #include "ash/shell_port.h" 19 #include "ash/shell_port.h"
19 #include "ash/test/ash_test_base.h" 20 #include "ash/test/ash_test_base.h"
20 #include "ash/test/shell_test_api.h" 21 #include "ash/test/shell_test_api.h"
21 #include "ash/test/test_session_controller_client.h" 22 #include "ash/test/test_session_controller_client.h"
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior()); 457 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior());
457 458
458 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); 459 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
459 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_NEVER, shelf->auto_hide_behavior()); 460 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_NEVER, shelf->auto_hide_behavior());
460 } 461 }
461 462
462 // Tests that the cursor-filter is ahead of the drag-drop controller in the 463 // Tests that the cursor-filter is ahead of the drag-drop controller in the
463 // pre-target list. 464 // pre-target list.
464 TEST_F(ShellTest, TestPreTargetHandlerOrder) { 465 TEST_F(ShellTest, TestPreTargetHandlerOrder) {
465 // TODO: investigate failure in mash, http://crbug.com/695758. 466 // TODO: investigate failure in mash, http://crbug.com/695758.
466 if (ShellPort::Get()->IsRunningInMash()) 467 if (Shell::GetAshConfig() == Config::MASH)
467 return; 468 return;
468 469
469 Shell* shell = Shell::Get(); 470 Shell* shell = Shell::Get();
470 ui::EventTargetTestApi test_api(shell); 471 ui::EventTargetTestApi test_api(shell);
471 test::ShellTestApi shell_test_api(shell); 472 test::ShellTestApi shell_test_api(shell);
472 473
473 const ui::EventHandlerList& handlers = test_api.pre_target_handlers(); 474 const ui::EventHandlerList& handlers = test_api.pre_target_handlers();
474 ui::EventHandlerList::const_iterator cursor_filter = 475 ui::EventHandlerList::const_iterator cursor_filter =
475 std::find(handlers.begin(), handlers.end(), shell->mouse_cursor_filter()); 476 std::find(handlers.begin(), handlers.end(), shell->mouse_cursor_filter());
476 ui::EventHandlerList::const_iterator drag_drop = std::find( 477 ui::EventHandlerList::const_iterator drag_drop = std::find(
(...skipping 30 matching lines...) Expand all
507 508
508 private: 509 private:
509 DISALLOW_COPY_AND_ASSIGN(ShellTest2); 510 DISALLOW_COPY_AND_ASSIGN(ShellTest2);
510 }; 511 };
511 512
512 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { 513 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) {
513 // TODO: delete this test when conversion to mash is done. This test isn't 514 // TODO: delete this test when conversion to mash is done. This test isn't
514 // applicable to mash as all windows must be destroyed before ash, that isn't 515 // applicable to mash as all windows must be destroyed before ash, that isn't
515 // the case with classic-ash where embedders can separately create 516 // the case with classic-ash where embedders can separately create
516 // aura::Windows. 517 // aura::Windows.
517 if (ShellPort::Get()->IsRunningInMash()) 518 if (Shell::GetAshConfig() == Config::MASH)
518 return; 519 return;
519 520
520 window_.reset(new aura::Window(NULL)); 521 window_.reset(new aura::Window(NULL));
521 window_->Init(ui::LAYER_NOT_DRAWN); 522 window_->Init(ui::LAYER_NOT_DRAWN);
522 } 523 }
523 524
524 } // namespace ash 525 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell_port.h ('k') | ash/sticky_keys/sticky_keys_overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698