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

Unified Diff: ash/common/system/date/date_view_unittest.cc

Issue 2732813002: chromeos: Move files in //ash/common to //ash, part 1 (Closed)
Patch Set: rebase Created 3 years, 9 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 | « ash/common/system/date/date_view.cc ('k') | ash/common/system/date/system_info_default_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/date/date_view_unittest.cc
diff --git a/ash/common/system/date/date_view_unittest.cc b/ash/common/system/date/date_view_unittest.cc
deleted file mode 100644
index 94699a627c749349a972066725afc7c1f52cbe3d..0000000000000000000000000000000000000000
--- a/ash/common/system/date/date_view_unittest.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2013 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 "ash/common/system/date/date_view.h"
-
-#include "ash/common/test/ash_test.h"
-#include "ui/views/controls/label.h"
-
-namespace ash {
-namespace tray {
-
-class TimeViewTest : public AshTest {
- public:
- TimeViewTest() {}
- ~TimeViewTest() override {}
-
- TimeView* time_view() { return time_view_.get(); }
-
- // Access to private fields of |time_view_|.
- views::Label* horizontal_label() {
- return time_view_->horizontal_label_.get();
- }
- views::Label* vertical_label_hours() {
- return time_view_->vertical_label_hours_.get();
- }
- views::Label* vertical_label_minutes() {
- return time_view_->vertical_label_minutes_.get();
- }
-
- // Creates a time view with horizontal or vertical |clock_layout|.
- void CreateTimeView(TimeView::ClockLayout clock_layout) {
- time_view_.reset(new TimeView(clock_layout));
- }
-
- private:
- std::unique_ptr<TimeView> time_view_;
-
- DISALLOW_COPY_AND_ASSIGN(TimeViewTest);
-};
-
-// Test the basics of the time view, mostly to ensure we don't leak memory.
-TEST_F(TimeViewTest, Basics) {
- // A newly created horizontal clock only has the horizontal label.
- CreateTimeView(TimeView::ClockLayout::HORIZONTAL_CLOCK);
- EXPECT_EQ(time_view(), horizontal_label()->parent());
- EXPECT_FALSE(vertical_label_hours()->parent());
- EXPECT_FALSE(vertical_label_minutes()->parent());
-
- // Switching the clock to vertical updates the labels.
- time_view()->UpdateClockLayout(TimeView::ClockLayout::VERTICAL_CLOCK);
- EXPECT_FALSE(horizontal_label()->parent());
- EXPECT_EQ(time_view(), vertical_label_hours()->parent());
- EXPECT_EQ(time_view(), vertical_label_minutes()->parent());
-
- // Switching back to horizontal updates the labels again.
- time_view()->UpdateClockLayout(TimeView::ClockLayout::HORIZONTAL_CLOCK);
- EXPECT_EQ(time_view(), horizontal_label()->parent());
- EXPECT_FALSE(vertical_label_hours()->parent());
- EXPECT_FALSE(vertical_label_minutes()->parent());
-}
-
-} // namespace tray
-} // namespace ash
« no previous file with comments | « ash/common/system/date/date_view.cc ('k') | ash/common/system/date/system_info_default_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698