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

Side by Side Diff: ash/shell_unittest.cc

Issue 2718763003: chromeos: makes more tests run in both mash and ash (Closed)
Patch Set: Created 3 years, 10 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/common/session/session_state_delegate.h" 10 #include "ash/common/session/session_state_delegate.h"
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); 452 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
453 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior()); 453 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior());
454 454
455 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); 455 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
456 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_NEVER, shelf->auto_hide_behavior()); 456 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_NEVER, shelf->auto_hide_behavior());
457 } 457 }
458 458
459 // Tests that the cursor-filter is ahead of the drag-drop controller in the 459 // Tests that the cursor-filter is ahead of the drag-drop controller in the
460 // pre-target list. 460 // pre-target list.
461 TEST_F(ShellTest, TestPreTargetHandlerOrder) { 461 TEST_F(ShellTest, TestPreTargetHandlerOrder) {
462 // TODO: investigate failure in mash, http://crbug.com/695758.
463 if (WmShell::Get()->IsRunningInMash())
464 return;
465
462 Shell* shell = Shell::GetInstance(); 466 Shell* shell = Shell::GetInstance();
463 ui::EventTargetTestApi test_api(shell); 467 ui::EventTargetTestApi test_api(shell);
464 test::ShellTestApi shell_test_api(shell); 468 test::ShellTestApi shell_test_api(shell);
465 469
466 const ui::EventHandlerList& handlers = test_api.pre_target_handlers(); 470 const ui::EventHandlerList& handlers = test_api.pre_target_handlers();
467 ui::EventHandlerList::const_iterator cursor_filter = 471 ui::EventHandlerList::const_iterator cursor_filter =
468 std::find(handlers.begin(), handlers.end(), shell->mouse_cursor_filter()); 472 std::find(handlers.begin(), handlers.end(), shell->mouse_cursor_filter());
469 ui::EventHandlerList::const_iterator drag_drop = std::find( 473 ui::EventHandlerList::const_iterator drag_drop = std::find(
470 handlers.begin(), handlers.end(), shell_test_api.drag_drop_controller()); 474 handlers.begin(), handlers.end(), shell_test_api.drag_drop_controller());
471 EXPECT_NE(handlers.end(), cursor_filter); 475 EXPECT_NE(handlers.end(), cursor_filter);
(...skipping 24 matching lines...) Expand all
496 ~ShellTest2() override {} 500 ~ShellTest2() override {}
497 501
498 protected: 502 protected:
499 std::unique_ptr<aura::Window> window_; 503 std::unique_ptr<aura::Window> window_;
500 504
501 private: 505 private:
502 DISALLOW_COPY_AND_ASSIGN(ShellTest2); 506 DISALLOW_COPY_AND_ASSIGN(ShellTest2);
503 }; 507 };
504 508
505 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { 509 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) {
510 // This test isn't applicable to mash as all windows must be destroyed before
511 // the WindowManager/Shell is. The case of content creating a Window isn't
512 // valid as content is in another process in mash.
msw 2017/02/24 21:25:35 nit: "a separate process from"? (or more to the po
sky 2017/02/24 21:43:47 Done.
513 if (WmShell::Get()->IsRunningInMash())
514 return;
515
506 window_.reset(new aura::Window(NULL)); 516 window_.reset(new aura::Window(NULL));
507 window_->Init(ui::LAYER_NOT_DRAWN); 517 window_->Init(ui::LAYER_NOT_DRAWN);
508 } 518 }
509 519
510 } // namespace ash 520 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698