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

Side by Side Diff: core/cross/image_utils_test.cc

Issue 164130: This CL adds client.toDataURL which gets the contents... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 11 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 | « core/cross/image_utils.h ('k') | core/cross/renderer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2009, Google Inc. 2 * Copyright 2009, Google Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 25 matching lines...) Expand all
36 #include "base/file_path.h" 36 #include "base/file_path.h"
37 #include "utils/cross/file_path_utils.h" 37 #include "utils/cross/file_path_utils.h"
38 38
39 namespace o3d { 39 namespace o3d {
40 40
41 class ImageTest : public testing::Test { 41 class ImageTest : public testing::Test {
42 }; 42 };
43 43
44 TEST_F(ImageTest, CheckImageDimensions) { 44 TEST_F(ImageTest, CheckImageDimensions) {
45 EXPECT_TRUE(image::CheckImageDimensions(1u, 1u)); 45 EXPECT_TRUE(image::CheckImageDimensions(1u, 1u));
46 EXPECT_FALSE(image::CheckImageDimensions(0u, 1u));
47 EXPECT_FALSE(image::CheckImageDimensions(1u, 0u));
48 EXPECT_TRUE(image::CheckImageDimensions(image::kMaxImageDimension, 46 EXPECT_TRUE(image::CheckImageDimensions(image::kMaxImageDimension,
49 image::kMaxImageDimension)); 47 image::kMaxImageDimension));
50 EXPECT_FALSE(image::CheckImageDimensions(0u, image::kMaxImageDimension)); 48 EXPECT_FALSE(image::CheckImageDimensions(0u, image::kMaxImageDimension + 1));
51 EXPECT_FALSE(image::CheckImageDimensions(image::kMaxImageDimension, 0u)); 49 EXPECT_FALSE(image::CheckImageDimensions(image::kMaxImageDimension + 1, 0u));
52 } 50 }
53 51
54 TEST_F(ImageTest, ComputeMipMapCount) { 52 TEST_F(ImageTest, ComputeMipMapCount) {
55 EXPECT_EQ(image::ComputeMipMapCount(1, 1), 1); 53 EXPECT_EQ(image::ComputeMipMapCount(1, 1), 1);
56 EXPECT_EQ(image::ComputeMipMapCount(2, 2), 2); 54 EXPECT_EQ(image::ComputeMipMapCount(2, 2), 2);
57 EXPECT_EQ(image::ComputeMipMapCount(2, 1), 2); 55 EXPECT_EQ(image::ComputeMipMapCount(2, 1), 2);
58 EXPECT_EQ(image::ComputeMipMapCount(256, 1), 9); 56 EXPECT_EQ(image::ComputeMipMapCount(256, 1), 9);
59 EXPECT_EQ(image::ComputeMipMapCount(256, 256), 9); 57 EXPECT_EQ(image::ComputeMipMapCount(256, 256), 9);
60 } 58 }
61 59
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 TEST_F(ImageTest, GetFileTypeFromMimeType) { 295 TEST_F(ImageTest, GetFileTypeFromMimeType) {
298 EXPECT_EQ(image::PNG, image::GetFileTypeFromMimeType("image/png")); 296 EXPECT_EQ(image::PNG, image::GetFileTypeFromMimeType("image/png"));
299 EXPECT_EQ(image::JPEG, image::GetFileTypeFromMimeType("image/jpeg")); 297 EXPECT_EQ(image::JPEG, image::GetFileTypeFromMimeType("image/jpeg"));
300 EXPECT_EQ(image::UNKNOWN, image::GetFileTypeFromFilename("text/plain")); 298 EXPECT_EQ(image::UNKNOWN, image::GetFileTypeFromFilename("text/plain"));
301 EXPECT_EQ(image::UNKNOWN, 299 EXPECT_EQ(image::UNKNOWN,
302 image::GetFileTypeFromFilename("application/x-123")); 300 image::GetFileTypeFromFilename("application/x-123"));
303 } 301 }
304 302
305 } // namespace 303 } // namespace
306 304
OLDNEW
« no previous file with comments | « core/cross/image_utils.h ('k') | core/cross/renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698