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

Side by Side Diff: ui/gfx/icon_util_unittest.cc

Issue 469003009: ui: Move win gfx tests into gfx_unittests target. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix IconUtilTest Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/gfx_tests.gyp ('k') | ui/ui_unittests.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/icon_util.h" 5 #include "ui/gfx/icon_util.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "third_party/skia/include/core/SkBitmap.h" 12 #include "third_party/skia/include/core/SkBitmap.h"
13 #include "ui/gfx/gfx_paths.h" 13 #include "ui/gfx/gfx_paths.h"
14 #include "ui/gfx/icon_util_unittests_resource.h" 14 #include "ui/gfx/icon_util_unittests_resource.h"
15 #include "ui/gfx/image/image.h" 15 #include "ui/gfx/image/image.h"
16 #include "ui/gfx/image/image_family.h" 16 #include "ui/gfx/image/image_family.h"
17 #include "ui/gfx/size.h" 17 #include "ui/gfx/size.h"
18 18
19 namespace { 19 namespace {
20 20
21 static const char kSmallIconName[] = "icon_util/16_X_16_icon.ico"; 21 static const char kSmallIconName[] = "icon_util/16_X_16_icon.ico";
22 static const char kLargeIconName[] = "icon_util/128_X_128_icon.ico"; 22 static const char kLargeIconName[] = "icon_util/128_X_128_icon.ico";
23 static const char kTempIconFilename[] = "temp_test_icon.ico"; 23 static const char kTempIconFilename[] = "temp_test_icon.ico";
24 24
25 } // namespace 25 } // namespace
26 26
27 class IconUtilTest : public testing::Test { 27 class IconUtilTest : public testing::Test {
28 public: 28 public:
29 virtual void SetUp() OVERRIDE { 29 virtual void SetUp() OVERRIDE {
30 PathService::Get(gfx::DIR_TEST_DATA, &test_data_directory_); 30 gfx::RegisterPathProvider();
31 ASSERT_TRUE(PathService::Get(gfx::DIR_TEST_DATA, &test_data_directory_));
31 temp_directory_.CreateUniqueTempDir(); 32 temp_directory_.CreateUniqueTempDir();
32 } 33 }
33 34
34 static const int kSmallIconWidth = 16; 35 static const int kSmallIconWidth = 16;
35 static const int kSmallIconHeight = 16; 36 static const int kSmallIconHeight = 16;
36 static const int kLargeIconWidth = 128; 37 static const int kLargeIconWidth = 128;
37 static const int kLargeIconHeight = 128; 38 static const int kLargeIconHeight = 128;
38 39
39 // Given a file name for an .ico file and an image dimensions, this 40 // Given a file name for an .ico file and an image dimensions, this
40 // function loads the icon and returns an HICON handle. 41 // function loads the icon and returns an HICON handle.
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 } 423 }
423 424
424 // This tests that kNumIconDimensionsUpToMediumSize has the correct value. 425 // This tests that kNumIconDimensionsUpToMediumSize has the correct value.
425 TEST_F(IconUtilTest, TestNumIconDimensionsUpToMediumSize) { 426 TEST_F(IconUtilTest, TestNumIconDimensionsUpToMediumSize) {
426 ASSERT_LE(IconUtil::kNumIconDimensionsUpToMediumSize, 427 ASSERT_LE(IconUtil::kNumIconDimensionsUpToMediumSize,
427 IconUtil::kNumIconDimensions); 428 IconUtil::kNumIconDimensions);
428 EXPECT_EQ(IconUtil::kMediumIconSize, 429 EXPECT_EQ(IconUtil::kMediumIconSize,
429 IconUtil::kIconDimensions[ 430 IconUtil::kIconDimensions[
430 IconUtil::kNumIconDimensionsUpToMediumSize - 1]); 431 IconUtil::kNumIconDimensionsUpToMediumSize - 1]);
431 } 432 }
OLDNEW
« no previous file with comments | « ui/gfx/gfx_tests.gyp ('k') | ui/ui_unittests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698