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

Side by Side Diff: chrome/browser/ui/views/frame/immersive_mode_controller_ash_browsertest.cc

Issue 16871010: Rewrite scoped_ptr<T>(NULL) to use the default ctor in chrome/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h" 5 #include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shelf/shelf_layout_manager.h" 9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shelf/shelf_types.h" 10 #include "ash/shelf/shelf_types.h"
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 controller()->OnMouseEvent(&move); 444 controller()->OnMouseEvent(&move);
445 EXPECT_FALSE(controller()->IsRevealed()); 445 EXPECT_FALSE(controller()->IsRevealed());
446 } 446 }
447 447
448 // Test behavior when the mouse becomes hovered without moving. 448 // Test behavior when the mouse becomes hovered without moving.
449 IN_PROC_BROWSER_TEST_F(ImmersiveModeControllerAshTest, 449 IN_PROC_BROWSER_TEST_F(ImmersiveModeControllerAshTest,
450 MouseHoveredWithoutMoving) { 450 MouseHoveredWithoutMoving) {
451 chrome::ToggleFullscreenMode(browser()); 451 chrome::ToggleFullscreenMode(browser());
452 ASSERT_TRUE(controller()->IsEnabled()); 452 ASSERT_TRUE(controller()->IsEnabled());
453 453
454 scoped_ptr<ImmersiveRevealedLock> lock(NULL); 454 scoped_ptr<ImmersiveRevealedLock> lock;
455 455
456 // 1) Test that if the mouse becomes hovered without the mouse moving due to a 456 // 1) Test that if the mouse becomes hovered without the mouse moving due to a
457 // lock causing the top-of-window views to be revealed (and the mouse 457 // lock causing the top-of-window views to be revealed (and the mouse
458 // happening to be near the top of the screen), the top-of-window views do not 458 // happening to be near the top of the screen), the top-of-window views do not
459 // hide till the mouse moves off of the top-of-window views. 459 // hide till the mouse moves off of the top-of-window views.
460 controller()->SetMouseHoveredForTest(true); 460 controller()->SetMouseHoveredForTest(true);
461 EXPECT_FALSE(controller()->IsRevealed()); 461 EXPECT_FALSE(controller()->IsRevealed());
462 lock.reset(controller()->GetRevealedLock( 462 lock.reset(controller()->GetRevealedLock(
463 ImmersiveModeController::ANIMATE_REVEAL_NO)); 463 ImmersiveModeController::ANIMATE_REVEAL_NO));
464 EXPECT_TRUE(controller()->IsRevealed()); 464 EXPECT_TRUE(controller()->IsRevealed());
(...skipping 24 matching lines...) Expand all
489 chrome::ToggleFullscreenMode(browser()); 489 chrome::ToggleFullscreenMode(browser());
490 EXPECT_TRUE(controller()->IsRevealed()); 490 EXPECT_TRUE(controller()->IsRevealed());
491 lock.reset(); 491 lock.reset();
492 EXPECT_TRUE(controller()->IsRevealed()); 492 EXPECT_TRUE(controller()->IsRevealed());
493 controller()->SetMouseHoveredForTest(false); 493 controller()->SetMouseHoveredForTest(false);
494 EXPECT_FALSE(controller()->IsRevealed()); 494 EXPECT_FALSE(controller()->IsRevealed());
495 } 495 }
496 496
497 // GetRevealedLock() specific tests. 497 // GetRevealedLock() specific tests.
498 IN_PROC_BROWSER_TEST_F(ImmersiveModeControllerAshTest, RevealedLock) { 498 IN_PROC_BROWSER_TEST_F(ImmersiveModeControllerAshTest, RevealedLock) {
499 scoped_ptr<ImmersiveRevealedLock> lock1(NULL); 499 scoped_ptr<ImmersiveRevealedLock> lock1;
500 scoped_ptr<ImmersiveRevealedLock> lock2(NULL); 500 scoped_ptr<ImmersiveRevealedLock> lock2;
501 501
502 // Immersive mode is not on by default. 502 // Immersive mode is not on by default.
503 EXPECT_FALSE(controller()->IsEnabled()); 503 EXPECT_FALSE(controller()->IsEnabled());
504 504
505 // Move the mouse out of the way. 505 // Move the mouse out of the way.
506 controller()->SetMouseHoveredForTest(false); 506 controller()->SetMouseHoveredForTest(false);
507 507
508 // 1) Test acquiring and releasing a revealed state lock while immersive mode 508 // 1) Test acquiring and releasing a revealed state lock while immersive mode
509 // is disabled. Acquiring or releasing the lock should have no effect till 509 // is disabled. Acquiring or releasing the lock should have no effect till
510 // immersive mode is enabled. 510 // immersive mode is enabled.
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 waiter.reset(new FullscreenNotificationObserver()); 763 waiter.reset(new FullscreenNotificationObserver());
764 chrome::ToggleFullscreenMode(browser()); 764 chrome::ToggleFullscreenMode(browser());
765 waiter->Wait(); 765 waiter->Wait();
766 766
767 ASSERT_FALSE(controller()->IsEnabled()); 767 ASSERT_FALSE(controller()->IsEnabled());
768 EXPECT_EQ(ash::SHELF_VISIBLE, shelf->visibility_state()); 768 EXPECT_EQ(ash::SHELF_VISIBLE, shelf->visibility_state());
769 EXPECT_TRUE(controller()->ShouldHideTabIndicators()); 769 EXPECT_TRUE(controller()->ShouldHideTabIndicators());
770 } 770 }
771 771
772 #endif // defined(OS_CHROMEOS) 772 #endif // defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view_layout.cc ('k') | chrome/browser/ui/views/notifications/balloon_view_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698