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

Unified Diff: chrome/browser/gtk/tabs/tab_renderer_gtk_unittest.cc

Issue 6251001: Move chrome/browser/gtk/ to chrome/browser/ui/gtk/... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | « chrome/browser/gtk/tabs/tab_renderer_gtk.cc ('k') | chrome/browser/gtk/tabs/tab_strip_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/tabs/tab_renderer_gtk_unittest.cc
===================================================================
--- chrome/browser/gtk/tabs/tab_renderer_gtk_unittest.cc (revision 71352)
+++ chrome/browser/gtk/tabs/tab_renderer_gtk_unittest.cc (working copy)
@@ -1,74 +0,0 @@
-// Copyright (c) 2009 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 "chrome/browser/gtk/tabs/tab_renderer_gtk.h"
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-typedef TabRendererGtk::LoadingAnimation LoadingAnimation;
-
-const int kTestLoadingAnimationFrameCount = 10;
-const int kTestWaitingAnimationFrameCount = 40;
-const int kTestWaitingToLoadingFrameCountRatio = 4;
-
-const LoadingAnimation::Data kMockAnimationData =
- LoadingAnimation::Data(kTestLoadingAnimationFrameCount,
- kTestWaitingAnimationFrameCount,
- kTestWaitingToLoadingFrameCountRatio);
-
-TEST(LoadingAnimationTest, InitialState) {
- LoadingAnimation loading_animation(kMockAnimationData);
- EXPECT_EQ(TabRendererGtk::ANIMATION_NONE,
- loading_animation.animation_state());
- EXPECT_EQ(0, loading_animation.animation_frame());
-}
-
-TEST(LoadingAnimationTest, AdvanceWaitingFrames) {
- LoadingAnimation loading_animation(kMockAnimationData);
- loading_animation.ValidateLoadingAnimation(TabRendererGtk::ANIMATION_WAITING);
- EXPECT_EQ(TabRendererGtk::ANIMATION_WAITING,
- loading_animation.animation_state());
- EXPECT_EQ(1, loading_animation.animation_frame());
- loading_animation.ValidateLoadingAnimation(TabRendererGtk::ANIMATION_WAITING);
- EXPECT_EQ(TabRendererGtk::ANIMATION_WAITING,
- loading_animation.animation_state());
- EXPECT_EQ(2, loading_animation.animation_frame());
-
- for (int i = 2; i < kTestWaitingAnimationFrameCount - 1; ++i) {
- loading_animation.ValidateLoadingAnimation(
- TabRendererGtk::ANIMATION_WAITING);
- }
- EXPECT_EQ(TabRendererGtk::ANIMATION_WAITING,
- loading_animation.animation_state());
- EXPECT_EQ(kTestWaitingAnimationFrameCount - 1,
- loading_animation.animation_frame());
-
- loading_animation.ValidateLoadingAnimation(TabRendererGtk::ANIMATION_WAITING);
- EXPECT_EQ(TabRendererGtk::ANIMATION_WAITING,
- loading_animation.animation_state());
- EXPECT_EQ(0, loading_animation.animation_frame()) <<
- "The animation frame should have wrapped around to 0.";
-}
-
-TEST(LoadingAnimationTest, AdvanceFromWaitingToLoading) {
- LoadingAnimation loading_animation(kMockAnimationData);
- for (int i = 0; i < 2 * kTestWaitingToLoadingFrameCountRatio; ++i) {
- loading_animation.ValidateLoadingAnimation(
- TabRendererGtk::ANIMATION_WAITING);
- }
- EXPECT_EQ(TabRendererGtk::ANIMATION_WAITING,
- loading_animation.animation_state());
- EXPECT_EQ(2 * kTestWaitingToLoadingFrameCountRatio,
- loading_animation.animation_frame());
-
- loading_animation.ValidateLoadingAnimation(TabRendererGtk::ANIMATION_LOADING);
- EXPECT_EQ(TabRendererGtk::ANIMATION_LOADING,
- loading_animation.animation_state());
- EXPECT_EQ(kTestLoadingAnimationFrameCount - 1,
- loading_animation.animation_frame());
-}
-
-} // namespace
« no previous file with comments | « chrome/browser/gtk/tabs/tab_renderer_gtk.cc ('k') | chrome/browser/gtk/tabs/tab_strip_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698