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

Unified Diff: ash/app_list/app_list_unittest.cc

Issue 10388032: Move app list from ash to ui. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: fix win_aura bot and comments in #5 Created 8 years, 7 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/app_list/app_list_model_view.cc ('k') | ash/app_list/app_list_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/app_list/app_list_unittest.cc
===================================================================
--- ash/app_list/app_list_unittest.cc (revision 135932)
+++ ash/app_list/app_list_unittest.cc (working copy)
@@ -1,64 +0,0 @@
-// Copyright (c) 2012 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/app_list/app_list_item_view.h"
-#include "ash/app_list/app_list_model_view.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-struct ModelViewCalculateLayoutCase {
- gfx::Size screen_size;
- int num_of_tiles;
- gfx::Size expected_icon_size;
- int expected_rows;
- int expected_cols;
-};
-
-} // namespace
-
-TEST(AppListTest, ModelViewCalculateLayout) {
- // kMinTitleWidth is the average width of 15 chars of default size 12 font in
- // chromeos. Override here to avoid flakiness from different default font on
- // bots.
- const int kMinTitleWidth = 90;
- ash::AppListItemView::SetMinTitleWidth(kMinTitleWidth);
-
- const int kLauncherHeight = 50;
- const ModelViewCalculateLayoutCase kCases[] = {
- { gfx::Size(1024, 768), 4, gfx::Size(128, 128), 2, 3 },
- { gfx::Size(1024, 768), 29, gfx::Size(64, 64), 5, 6 },
- { gfx::Size(1024, 768), 40, gfx::Size(48, 48), 5, 8 },
- { gfx::Size(1024, 768), 48, gfx::Size(48, 48), 6, 8 },
-
- { gfx::Size(1280, 1024), 4, gfx::Size(128, 128), 2, 3 },
- { gfx::Size(1280, 1024), 29, gfx::Size(64, 64), 5, 7 },
- { gfx::Size(1280, 1024), 50, gfx::Size(64, 64), 7, 8 },
- { gfx::Size(1280, 1024), 70, gfx::Size(48, 48), 7, 10 },
- { gfx::Size(1280, 1024), 99, gfx::Size(48, 48), 9, 11 },
-
- { gfx::Size(1600, 900), 4, gfx::Size(128, 128), 2, 3 },
- { gfx::Size(1600, 900), 29, gfx::Size(64, 64), 4, 8 },
-
- // Not able to fit into screen case.
- { gfx::Size(1024, 768), 50, gfx::Size(32, 32), 6, 9 },
- { gfx::Size(1280, 1024), 100, gfx::Size(32, 32), 10, 11 },
- };
-
- for (size_t i = 0; i < arraysize(kCases); ++i) {
- gfx::Size icon_size;
- int rows = 0;
- int cols = 0;
- gfx::Size content_size(kCases[i].screen_size.width(),
- kCases[i].screen_size.height() - kLauncherHeight);
- ash::AppListModelView::CalculateLayout(content_size,
- kCases[i].num_of_tiles,
- &icon_size,
- &rows,
- &cols);
- EXPECT_EQ(kCases[i].expected_icon_size, icon_size) << "i=" << i;
- EXPECT_EQ(kCases[i].expected_rows, rows) << "i=" << i;
- EXPECT_EQ(kCases[i].expected_cols, cols) << "i=" << i;
- }
-}
« no previous file with comments | « ash/app_list/app_list_model_view.cc ('k') | ash/app_list/app_list_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698