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

Unified Diff: ui/views/animation/bounds_animator_unittest.cc

Issue 10790115: views: Put bounds_animation_unittest.cc into views namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/focus/focus_manager_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/animation/bounds_animator_unittest.cc
diff --git a/ui/views/animation/bounds_animator_unittest.cc b/ui/views/animation/bounds_animator_unittest.cc
index bf1f08cb9e18312072a934b14f9e96ad4bfc3833..1d1b957ef5d1ad00eb693f602b73536b5fde0236 100644
--- a/ui/views/animation/bounds_animator_unittest.cc
+++ b/ui/views/animation/bounds_animator_unittest.cc
@@ -2,22 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "ui/views/animation/bounds_animator.h"
+
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/animation/slide_animation.h"
#include "ui/base/animation/test_animation_delegate.h"
-#include "ui/views/animation/bounds_animator.h"
#include "ui/views/view.h"
-using views::BoundsAnimator;
using ui::Animation;
using ui::SlideAnimation;
using ui::TestAnimationDelegate;
+namespace views {
namespace {
class TestBoundsAnimator : public BoundsAnimator {
public:
- explicit TestBoundsAnimator(views::View* view) : BoundsAnimator(view) {
+ explicit TestBoundsAnimator(View* view) : BoundsAnimator(view) {
}
protected:
@@ -33,29 +34,26 @@ class TestBoundsAnimator : public BoundsAnimator {
class OwnedDelegate : public BoundsAnimator::OwnedAnimationDelegate {
public:
- OwnedDelegate() {
- deleted_ = false;
- canceled_ = false;
- }
+ OwnedDelegate() {}
- ~OwnedDelegate() {
+ virtual ~OwnedDelegate() {
deleted_ = true;
}
- static bool get_and_clear_deleted() {
+ static bool GetAndClearDeleted() {
bool value = deleted_;
deleted_ = false;
return value;
}
- static bool get_and_clear_canceled() {
+ static bool GetAndClearCanceled() {
bool value = canceled_;
canceled_ = false;
return value;
}
- // AnimationDelegate:
- virtual void AnimationCanceled(const Animation* animation) {
+ // Overridden from ui::AnimationDelegate:
+ virtual void AnimationCanceled(const Animation* animation) OVERRIDE {
canceled_ = true;
}
@@ -68,14 +66,13 @@ class OwnedDelegate : public BoundsAnimator::OwnedAnimationDelegate {
// static
bool OwnedDelegate::deleted_ = false;
-
-// static
bool OwnedDelegate::canceled_ = false;
-class TestView : public views::View {
+class TestView : public View {
public:
TestView() {}
- virtual void SchedulePaintInRect(const gfx::Rect& r) {
+
+ virtual void SchedulePaintInRect(const gfx::Rect& r) OVERRIDE {
if (dirty_rect_.IsEmpty())
dirty_rect_ = r;
else
@@ -146,8 +143,8 @@ TEST_F(BoundsAnimatorTest, DeleteDelegateOnCancel) {
EXPECT_FALSE(animator()->IsAnimating());
// The cancel should both cancel the delegate and delete it.
- EXPECT_TRUE(OwnedDelegate::get_and_clear_canceled());
- EXPECT_TRUE(OwnedDelegate::get_and_clear_deleted());
+ EXPECT_TRUE(OwnedDelegate::GetAndClearCanceled());
+ EXPECT_TRUE(OwnedDelegate::GetAndClearDeleted());
}
// Make sure an AnimationDelegate is deleted when another animation is
@@ -159,8 +156,8 @@ TEST_F(BoundsAnimatorTest, DeleteDelegateOnNewAnimate) {
animator()->AnimateViewTo(child(), gfx::Rect(0, 0, 10, 10));
// Starting a new animation should both cancel the delegate and delete it.
- EXPECT_TRUE(OwnedDelegate::get_and_clear_deleted());
- EXPECT_TRUE(OwnedDelegate::get_and_clear_canceled());
+ EXPECT_TRUE(OwnedDelegate::GetAndClearDeleted());
+ EXPECT_TRUE(OwnedDelegate::GetAndClearCanceled());
}
// Makes sure StopAnimating works.
@@ -176,6 +173,8 @@ TEST_F(BoundsAnimatorTest, StopAnimating) {
EXPECT_FALSE(animator()->IsAnimating());
// Stopping should both cancel the delegate and delete it.
- EXPECT_TRUE(OwnedDelegate::get_and_clear_deleted());
- EXPECT_TRUE(OwnedDelegate::get_and_clear_canceled());
+ EXPECT_TRUE(OwnedDelegate::GetAndClearDeleted());
+ EXPECT_TRUE(OwnedDelegate::GetAndClearCanceled());
}
+
+} // namespace views
« no previous file with comments | « no previous file | ui/views/focus/focus_manager_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698