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

Side by Side Diff: ash/system/tray/system_tray_unittest.cc

Issue 1867223004: Convert //ash from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 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/system/tray/system_tray_delegate.cc ('k') | ash/system/tray/tray_background_view.h » ('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/system/tray/system_tray.h" 5 #include "ash/system/tray/system_tray.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/accessibility_delegate.h" 9 #include "ash/accessibility_delegate.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 EXPECT_TRUE(window_bounds.y() >= tray_bounds.y()); 384 EXPECT_TRUE(window_bounds.y() >= tray_bounds.y());
385 } 385 }
386 386
387 TEST_F(SystemTrayTest, PersistentBubble) { 387 TEST_F(SystemTrayTest, PersistentBubble) {
388 SystemTray* tray = GetSystemTray(); 388 SystemTray* tray = GetSystemTray();
389 ASSERT_TRUE(tray->GetWidget()); 389 ASSERT_TRUE(tray->GetWidget());
390 390
391 TestItem* test_item = new TestItem; 391 TestItem* test_item = new TestItem;
392 tray->AddTrayItem(test_item); 392 tray->AddTrayItem(test_item);
393 393
394 scoped_ptr<aura::Window> window(CreateTestWindowInShellWithId(0)); 394 std::unique_ptr<aura::Window> window(CreateTestWindowInShellWithId(0));
395 395
396 // Tests for usual default view. 396 // Tests for usual default view.
397 // Activating window. 397 // Activating window.
398 tray->ShowDefaultView(BUBBLE_CREATE_NEW); 398 tray->ShowDefaultView(BUBBLE_CREATE_NEW);
399 ASSERT_TRUE(tray->HasSystemBubble()); 399 ASSERT_TRUE(tray->HasSystemBubble());
400 wm::ActivateWindow(window.get()); 400 wm::ActivateWindow(window.get());
401 base::RunLoop().RunUntilIdle(); 401 base::RunLoop().RunUntilIdle();
402 ASSERT_FALSE(tray->HasSystemBubble()); 402 ASSERT_FALSE(tray->HasSystemBubble());
403 403
404 tray->ShowDefaultView(BUBBLE_CREATE_NEW); 404 tray->ShowDefaultView(BUBBLE_CREATE_NEW);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 ASSERT_TRUE(settings); 470 ASSERT_TRUE(settings);
471 EXPECT_TRUE(settings->visible()); 471 EXPECT_TRUE(settings->visible());
472 } 472 }
473 473
474 // Tests that if SetVisible(true) is called while animating to hidden that the 474 // Tests that if SetVisible(true) is called while animating to hidden that the
475 // tray becomes visible, and stops animating to hidden. 475 // tray becomes visible, and stops animating to hidden.
476 TEST_F(SystemTrayTest, SetVisibleDuringHideAnimation) { 476 TEST_F(SystemTrayTest, SetVisibleDuringHideAnimation) {
477 SystemTray* tray = GetSystemTray(); 477 SystemTray* tray = GetSystemTray();
478 ASSERT_TRUE(tray->visible()); 478 ASSERT_TRUE(tray->visible());
479 479
480 scoped_ptr<ui::ScopedAnimationDurationScaleMode> animation_duration; 480 std::unique_ptr<ui::ScopedAnimationDurationScaleMode> animation_duration;
481 animation_duration.reset( 481 animation_duration.reset(
482 new ui::ScopedAnimationDurationScaleMode( 482 new ui::ScopedAnimationDurationScaleMode(
483 ui::ScopedAnimationDurationScaleMode::SLOW_DURATION)); 483 ui::ScopedAnimationDurationScaleMode::SLOW_DURATION));
484 tray->SetVisible(false); 484 tray->SetVisible(false);
485 EXPECT_TRUE(tray->visible()); 485 EXPECT_TRUE(tray->visible());
486 EXPECT_EQ(0.0f, tray->layer()->GetTargetOpacity()); 486 EXPECT_EQ(0.0f, tray->layer()->GetTargetOpacity());
487 487
488 tray->SetVisible(true); 488 tray->SetVisible(true);
489 animation_duration.reset(); 489 animation_duration.reset();
490 tray->layer()->GetAnimator()->StopAnimating(); 490 tray->layer()->GetAnimator()->StopAnimating();
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 EXPECT_FALSE(view->active()); 535 EXPECT_FALSE(view->active());
536 536
537 generator.set_current_location(move_point); 537 generator.set_current_location(move_point);
538 generator.ReleaseTouch(); 538 generator.ReleaseTouch();
539 EXPECT_FALSE(view->active()); 539 EXPECT_FALSE(view->active());
540 } 540 }
541 #endif // OS_CHROMEOS 541 #endif // OS_CHROMEOS
542 542
543 } // namespace test 543 } // namespace test
544 } // namespace ash 544 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/system_tray_delegate.cc ('k') | ash/system/tray/tray_background_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698