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

Side by Side Diff: chrome/browser/ui/views/tabs/alert_indicator_button_unittest.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/tabs/alert_indicator_button.h" 5 #include "chrome/browser/ui/views/tabs/alert_indicator_button.h"
6 6
7 #include "chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h" 7 #include "chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h"
8 #include "chrome/browser/ui/views/tabs/tab.h" 8 #include "chrome/browser/ui/views/tabs/tab.h"
9 #include "chrome/browser/ui/views/tabs/tab_strip.h" 9 #include "chrome/browser/ui/views/tabs/tab_strip.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 void StopAnimation(Tab* tab) { 56 void StopAnimation(Tab* tab) {
57 ASSERT_TRUE(tab->alert_indicator_button_->fade_animation_); 57 ASSERT_TRUE(tab->alert_indicator_button_->fade_animation_);
58 tab->alert_indicator_button_->fade_animation_->Stop(); 58 tab->alert_indicator_button_->fade_animation_->Stop();
59 } 59 }
60 60
61 // Owned by TabStrip. 61 // Owned by TabStrip.
62 FakeBaseTabStripController* controller_; 62 FakeBaseTabStripController* controller_;
63 // Owns |tab_strip_|. 63 // Owns |tab_strip_|.
64 views::View parent_; 64 views::View parent_;
65 TabStrip* tab_strip_; 65 TabStrip* tab_strip_;
66 scoped_ptr<views::Widget> widget_; 66 std::unique_ptr<views::Widget> widget_;
67 67
68 private: 68 private:
69 DISALLOW_COPY_AND_ASSIGN(AlertIndicatorButtonTest); 69 DISALLOW_COPY_AND_ASSIGN(AlertIndicatorButtonTest);
70 }; 70 };
71 71
72 // This test verifies that the tab has its icon state updated when the alert 72 // This test verifies that the tab has its icon state updated when the alert
73 // animation fade-out finishes. 73 // animation fade-out finishes.
74 TEST_F(AlertIndicatorButtonTest, ButtonUpdateOnAudioStateAnimation) { 74 TEST_F(AlertIndicatorButtonTest, ButtonUpdateOnAudioStateAnimation) {
75 controller_->AddPinnedTab(0, false); 75 controller_->AddPinnedTab(0, false);
76 controller_->AddTab(1, true); 76 controller_->AddTab(1, true);
(...skipping 24 matching lines...) Expand all
101 101
102 // Rather than flakily waiting some unknown number of seconds for the fade 102 // Rather than flakily waiting some unknown number of seconds for the fade
103 // out animation to stop, reach out and stop the fade animation directly, 103 // out animation to stop, reach out and stop the fade animation directly,
104 // to make sure that it updates the tab appropriately when it's done. 104 // to make sure that it updates the tab appropriately when it's done.
105 StopAnimation(media_tab); 105 StopAnimation(media_tab);
106 106
107 EXPECT_TRUE(showing_icon(media_tab)); 107 EXPECT_TRUE(showing_icon(media_tab));
108 EXPECT_FALSE(showing_alert_indicator(media_tab)); 108 EXPECT_FALSE(showing_alert_indicator(media_tab));
109 EXPECT_FALSE(showing_close_button(media_tab)); 109 EXPECT_FALSE(showing_close_button(media_tab));
110 } 110 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/alert_indicator_button.cc ('k') | chrome/browser/ui/views/tabs/browser_tab_strip_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698