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