OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "chrome/renderer/safe_browsing/phishing_thumbnailer.h" | 6 #include "chrome/renderer/safe_browsing/phishing_thumbnailer.h" |
7 #include "content/public/test/render_widget_browsertest.h" | 7 #include "content/public/test/render_widget_test.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
12 | 12 |
13 namespace safe_browsing { | 13 namespace safe_browsing { |
14 | 14 |
15 class ThumbnailerTest : public content::RenderWidgetTest { | 15 class ThumbnailerTest : public content::RenderWidgetTest { |
16 public: | 16 public: |
17 ThumbnailerTest() {} | 17 ThumbnailerTest() {} |
18 | 18 |
19 protected: | 19 protected: |
20 virtual void ResizeAndPaint(const gfx::Size& page_size, | 20 virtual void ResizeAndPaint(const gfx::Size& page_size, |
21 const gfx::Size& desired_size, | 21 const gfx::Size& desired_size, |
22 SkBitmap* snapshot) { | 22 SkBitmap* snapshot) OVERRIDE { |
23 ASSERT_TRUE(snapshot); | 23 ASSERT_TRUE(snapshot); |
24 *snapshot = GrabPhishingThumbnail(view_, page_size, desired_size); | 24 *snapshot = GrabPhishingThumbnail(view_, page_size, desired_size); |
25 EXPECT_FALSE(snapshot->isNull()); | 25 EXPECT_FALSE(snapshot->isNull()); |
26 } | 26 } |
27 }; | 27 }; |
28 | 28 |
29 TEST_F(ThumbnailerTest, GrabPhishingThumbnail) { | 29 TEST_F(ThumbnailerTest, GrabPhishingThumbnail) { |
30 TestResizeAndPaint(); | 30 TestResizeAndPaint(); |
31 } | 31 } |
32 | 32 |
33 } // namespace safe_browsing | 33 } // namespace safe_browsing |
OLD | NEW |