MacViews: Disable animations when running views_unittests.

Disable animations to get TextfieldTest.DragToSelect to pass.
AuraTestHelper disables animations, so they were already disabled on non-Mac.
This change creates ViewsTestHelperMac that disables animation the same way
as ViewsTestHelperAura does.

BUG=378134

Review URL: https://codereview.chromium.org/378663002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282385 0039d316-1c4b-4281-b951-d872f2087c98
parent c02a9b3e
......@@ -6,14 +6,6 @@
namespace views {
#if !defined(USE_AURA)
// static
ViewsTestHelper* ViewsTestHelper::Create(base::MessageLoopForUI* message_loop,
ui::ContextFactory* context_factory) {
return new ViewsTestHelper;
}
#endif
ViewsTestHelper::ViewsTestHelper() {
}
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_VIEWS_TEST_VIEWS_TEST_HELPER_MAC_H_
#define UI_VIEWS_TEST_VIEWS_TEST_HELPER_MAC_H_
#include "base/memory/scoped_ptr.h"
#include "ui/views/test/views_test_helper.h"
namespace ui {
class ScopedAnimationDurationScaleMode;
}
namespace views {
class ViewsTestHelperMac : public ViewsTestHelper {
public:
ViewsTestHelperMac();
virtual ~ViewsTestHelperMac();
private:
// Disable animations during tests.
scoped_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_;
DISALLOW_COPY_AND_ASSIGN(ViewsTestHelperMac);
};
} // namespace views
#endif // UI_VIEWS_TEST_VIEWS_TEST_HELPER_MAC_H_
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/views/test/views_test_helper_mac.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
namespace views {
// static
ViewsTestHelper* ViewsTestHelper::Create(base::MessageLoopForUI* message_loop,
ui::ContextFactory* context_factory) {
return new ViewsTestHelperMac;
}
ViewsTestHelperMac::ViewsTestHelperMac()
: zero_duration_mode_(new ui::ScopedAnimationDurationScaleMode(
ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)) {
}
ViewsTestHelperMac::~ViewsTestHelperMac() {
}
} // namespace views
......@@ -627,6 +627,8 @@
'test/views_test_helper.h',
'test/views_test_helper_aura.cc',
'test/views_test_helper_aura.h',
'test/views_test_helper_mac.h',
'test/views_test_helper_mac.mm',
'test/widget_test.cc',
'test/widget_test.h',
'test/widget_test_aura.cc',
......
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