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

Side by Side Diff: ash/shell_unittest.cc

Issue 2718763003: chromeos: makes more tests run in both mash and ash (Closed)
Patch Set: disable more ShelfViewTests Created 3 years, 9 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/shelf/shelf_view_unittest.cc ('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/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 // TODO: delete this test when conversion to mash is done. This test isn't
511 // applicable to mash as all windows must be destroyed before ash, that isn't
512 // the case with classic-ash where embedders can separately create
513 // aura::Windows.
514 if (WmShell::Get()->IsRunningInMash())
515 return;
516
506 window_.reset(new aura::Window(NULL)); 517 window_.reset(new aura::Window(NULL));
507 window_->Init(ui::LAYER_NOT_DRAWN); 518 window_->Init(ui::LAYER_NOT_DRAWN);
508 } 519 }
509 520
510 } // namespace ash 521 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_view_unittest.cc ('k') | ash/sticky_keys/sticky_keys_overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698