| 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/render_widget_browsertest.h" | |
| 7 #include "chrome/renderer/safe_browsing/phishing_thumbnailer.h" | 6 #include "chrome/renderer/safe_browsing/phishing_thumbnailer.h" |
| 7 #include "content/renderer/render_widget_browsertest.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/WebSize.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/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 RenderWidgetTest { | 15 class ThumbnailerTest : public 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) { |
| 23 ASSERT_TRUE(snapshot); | 23 ASSERT_TRUE(snapshot); |
| 24 *snapshot = GrabPhishingThumbnail(view_.get(), page_size, desired_size); | 24 *snapshot = GrabPhishingThumbnail(view_.get(), 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 |