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

Side by Side Diff: skia/ext/skia_utils_ios_unittest.mm

Issue 1413903008: Add LargeIconCache and LargeIconServiceFactory for iOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits for unit test Created 5 years, 1 month 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "skia/ext/skia_utils_ios.h" 5 #include "skia/ext/skia_utils_ios.h"
6 6
7 #import <ImageIO/ImageIO.h> 7 #import <ImageIO/ImageIO.h>
8 #import <UIKit/UIKit.h> 8 #import <UIKit/UIKit.h>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 742
743 TEST_F(SkiaUtilsIosTest, Image88x88OrLarger) { 743 TEST_F(SkiaUtilsIosTest, Image88x88OrLarger) {
744 std::vector<SkBitmap> bitmaps( 744 std::vector<SkBitmap> bitmaps(
745 gfx::ImageDataToSkBitmaps(StringToNSData(kIco88x88EncodedData))); 745 gfx::ImageDataToSkBitmaps(StringToNSData(kIco88x88EncodedData)));
746 if (base::ios::IsRunningOnOrLater(8, 1, 1)) 746 if (base::ios::IsRunningOnOrLater(8, 1, 1))
747 EXPECT_EQ(0UL, bitmaps.size()); 747 EXPECT_EQ(0UL, bitmaps.size());
748 else 748 else
749 EXPECT_EQ(1UL, bitmaps.size()); 749 EXPECT_EQ(1UL, bitmaps.size());
750 } 750 }
751 751
752 TEST_F(SkiaUtilsIosTest, UIColorFromSkColor) {
753 SkColor color = SkColorSetARGB(50, 100, 150, 200);
754 UIColor* ios_color = gfx::UIColorFromSkColor(color);
755 CGFloat red, green, blue, alpha;
756 [ios_color getRed:&red green:&green blue:&blue alpha:&alpha];
757 EXPECT_EQ(50, static_cast<int>(alpha * 255 + 0.5f));
758 EXPECT_EQ(100, static_cast<int>(red * 255 + 0.5f));
759 EXPECT_EQ(150, static_cast<int>(green * 255 + 0.5f));
760 EXPECT_EQ(200, static_cast<int>(blue * 255 + 0.5f));
761 }
762
752 } // namespace 763 } // namespace
753 764
OLDNEW
« ios/chrome/browser/favicon/large_icon_cache.cc ('K') | « skia/ext/skia_utils_ios.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698