OLD | NEW |
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 "chrome/browser/thumbnails/simple_thumbnail_crop.h" | 5 #include "chrome/browser/thumbnails/simple_thumbnail_crop.h" |
6 | 6 |
7 #include "base/basictypes.h" | |
8 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
9 #include "chrome/browser/thumbnails/thumbnailing_context.h" | 8 #include "chrome/browser/thumbnails/thumbnailing_context.h" |
10 #include "content/public/browser/notification_service.h" | 9 #include "content/public/browser/notification_service.h" |
11 #include "content/public/browser/notification_types.h" | 10 #include "content/public/browser/notification_types.h" |
12 #include "content/public/test/mock_render_process_host.h" | 11 #include "content/public/test/mock_render_process_host.h" |
13 #include "content/public/test/test_renderer_host.h" | 12 #include "content/public/test/test_renderer_host.h" |
14 #include "skia/ext/platform_canvas.h" | 13 #include "skia/ext/platform_canvas.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "third_party/skia/include/core/SkColorPriv.h" | 15 #include "third_party/skia/include/core/SkColorPriv.h" |
17 #include "ui/gfx/canvas.h" | 16 #include "ui/gfx/canvas.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 EXPECT_LT(0, clip_rect.x()); | 210 EXPECT_LT(0, clip_rect.x()); |
212 EXPECT_GE(2000, clip_rect.width()); | 211 EXPECT_GE(2000, clip_rect.width()); |
213 EXPECT_EQ(800, clip_rect.height()); | 212 EXPECT_EQ(800, clip_rect.height()); |
214 | 213 |
215 clip_rect = SimpleThumbnailCrop::GetClippingRect( | 214 clip_rect = SimpleThumbnailCrop::GetClippingRect( |
216 gfx::Size(900, 600), desired_size, &clip_result); | 215 gfx::Size(900, 600), desired_size, &clip_result); |
217 EXPECT_EQ(thumbnails::CLIP_RESULT_NOT_CLIPPED, clip_result); | 216 EXPECT_EQ(thumbnails::CLIP_RESULT_NOT_CLIPPED, clip_result); |
218 EXPECT_EQ(gfx::Point(0, 0).ToString(), clip_rect.origin().ToString()); | 217 EXPECT_EQ(gfx::Point(0, 0).ToString(), clip_rect.origin().ToString()); |
219 EXPECT_EQ(gfx::Size(900, 600).ToString(), clip_rect.size().ToString()); | 218 EXPECT_EQ(gfx::Size(900, 600).ToString(), clip_rect.size().ToString()); |
220 } | 219 } |
OLD | NEW |