Commit 737ab673 authored by James Cook's avatar James Cook Committed by Commit Bot

cros: Eliminate ash::TrayItemView::DisableAnimationsForTest

crrev.com/c/723604 eliminated the only caller of this code from chrome.
The remaining calls are from tests in ash_unittests. AshTestBase
already installs a ui::ScopedAnimationDurationScaleMode::ZERO_DURATION
so the animations were already being skipped in these tests.

Bug: none
Test: ash_unittests
Change-Id: Ie95041cf03bee51b5d2786f03d3799241c75e513
Reviewed-on: https://chromium-review.googlesource.com/724221
Commit-Queue: James Cook <jamescook@chromium.org>
Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509611}
parent 673f22ef
...@@ -557,7 +557,6 @@ class CanSwitchUserTest : public AshTestBase { ...@@ -557,7 +557,6 @@ class CanSwitchUserTest : public AshTestBase {
void SetUp() override { void SetUp() override {
AshTestBase::SetUp(); AshTestBase::SetUp();
TrayItemView::DisableAnimationsForTest();
SystemTray* system_tray = GetPrimarySystemTray(); SystemTray* system_tray = GetPrimarySystemTray();
share_item_ = system_tray->GetScreenShareItem(); share_item_ = system_tray->GetScreenShareItem();
capture_item_ = system_tray->GetScreenCaptureItem(); capture_item_ = system_tray->GetScreenCaptureItem();
......
...@@ -8,15 +8,13 @@ ...@@ -8,15 +8,13 @@
#include "ash/media_controller.h" #include "ash/media_controller.h"
#include "ash/public/interfaces/media.mojom.h" #include "ash/public/interfaces/media.mojom.h"
#include "ash/session/session_controller.h" #include "ash/session/session_controller.h"
#include "ash/session/test_session_controller_client.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/system/status_area_widget.h" #include "ash/system/status_area_widget.h"
#include "ash/system/status_area_widget_test_helper.h" #include "ash/system/status_area_widget_test_helper.h"
#include "ash/system/tray/system_tray.h" #include "ash/system/tray/system_tray.h"
#include "ash/system/tray/system_tray_bubble.h" #include "ash/system/tray/system_tray_bubble.h"
#include "ash/system/tray/tray_item_view.h"
#include "ash/test/ash_test_base.h" #include "ash/test/ash_test_base.h"
#include "ash/test/ash_test_helper.h"
#include "ash/test_shell_delegate.h"
#include "ui/views/bubble/tray_bubble_view.h" #include "ui/views/bubble/tray_bubble_view.h"
namespace ash { namespace ash {
...@@ -39,9 +37,7 @@ class MultiProfileMediaTrayItemTest : public AshTestBase { ...@@ -39,9 +37,7 @@ class MultiProfileMediaTrayItemTest : public AshTestBase {
DISALLOW_COPY_AND_ASSIGN(MultiProfileMediaTrayItemTest); DISALLOW_COPY_AND_ASSIGN(MultiProfileMediaTrayItemTest);
}; };
// ash_unittests. still failing.
TEST_F(MultiProfileMediaTrayItemTest, NotifyMediaCaptureChange) { TEST_F(MultiProfileMediaTrayItemTest, NotifyMediaCaptureChange) {
TrayItemView::DisableAnimationsForTest();
GetSessionControllerClient()->CreatePredefinedUserSessions(2); GetSessionControllerClient()->CreatePredefinedUserSessions(2);
SystemTray* system_tray = GetPrimarySystemTray(); SystemTray* system_tray = GetPrimarySystemTray();
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "ash/system/screen_security/screen_share_tray_item.h" #include "ash/system/screen_security/screen_share_tray_item.h"
#include "ash/system/tray/system_tray.h" #include "ash/system/tray/system_tray.h"
#include "ash/system/tray/system_tray_notifier.h" #include "ash/system/tray/system_tray_notifier.h"
#include "ash/system/tray/tray_item_view.h"
#include "ash/test/ash_test_base.h" #include "ash/test/ash_test_base.h"
#include "base/callback.h" #include "base/callback.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
...@@ -46,11 +45,6 @@ class ScreenTrayItemTest : public AshTestBase { ...@@ -46,11 +45,6 @@ class ScreenTrayItemTest : public AshTestBase {
int stop_callback_hit_count() const { return stop_callback_hit_count_; } int stop_callback_hit_count() const { return stop_callback_hit_count_; }
void SetUp() override {
AshTestBase::SetUp();
TrayItemView::DisableAnimationsForTest();
}
void StartSession() { void StartSession() {
tray_item_->Start( tray_item_->Start(
base::Bind(&ScreenTrayItemTest::StopCallback, base::Unretained(this))); base::Bind(&ScreenTrayItemTest::StopCallback, base::Unretained(this)));
......
...@@ -23,9 +23,6 @@ namespace { ...@@ -23,9 +23,6 @@ namespace {
const int kTrayItemAnimationDurationMS = 200; const int kTrayItemAnimationDurationMS = 200;
// Animations can be disabled for testing.
bool animations_enabled = true;
} // namespace } // namespace
TrayItemView::TrayItemView(SystemTrayItem* owner) TrayItemView::TrayItemView(SystemTrayItem* owner)
...@@ -37,11 +34,6 @@ TrayItemView::TrayItemView(SystemTrayItem* owner) ...@@ -37,11 +34,6 @@ TrayItemView::TrayItemView(SystemTrayItem* owner)
TrayItemView::~TrayItemView() {} TrayItemView::~TrayItemView() {}
// static
void TrayItemView::DisableAnimationsForTest() {
animations_enabled = false;
}
void TrayItemView::CreateLabel() { void TrayItemView::CreateLabel() {
label_ = new views::Label; label_ = new views::Label;
AddChildView(label_); AddChildView(label_);
...@@ -55,9 +47,9 @@ void TrayItemView::CreateImageView() { ...@@ -55,9 +47,9 @@ void TrayItemView::CreateImageView() {
} }
void TrayItemView::SetVisible(bool set_visible) { void TrayItemView::SetVisible(bool set_visible) {
if (!GetWidget() || !animations_enabled || if (!GetWidget() ||
(ui::ScopedAnimationDurationScaleMode::duration_scale_mode() == ui::ScopedAnimationDurationScaleMode::duration_scale_mode() ==
ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)) { ui::ScopedAnimationDurationScaleMode::ZERO_DURATION) {
views::View::SetVisible(set_visible); views::View::SetVisible(set_visible);
return; return;
} }
......
...@@ -33,8 +33,6 @@ class ASH_EXPORT TrayItemView : public views::View, ...@@ -33,8 +33,6 @@ class ASH_EXPORT TrayItemView : public views::View,
explicit TrayItemView(SystemTrayItem* owner); explicit TrayItemView(SystemTrayItem* owner);
~TrayItemView() override; ~TrayItemView() override;
static void DisableAnimationsForTest();
// Convenience function for creating a child Label or ImageView. // Convenience function for creating a child Label or ImageView.
// Only one of the two should be called. // Only one of the two should be called.
void CreateLabel(); void CreateLabel();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment