Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / tests / ui_gfx_image_unittest.cc
blobc226cc1abf8028e64fcc7174fe4c4d4b5b109ff8
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
3 // found in the LICENSE file.
5 #include "base/memory/scoped_ptr.h"
6 #include "testing/gtest/include/gtest/gtest.h"
7 #include "third_party/skia/include/core/SkBitmap.h"
8 #include "ui/gfx/image/image.h"
9 #include "ui/gfx/image/image_unittest_util.h"
11 #if defined(TOOLKIT_VIEWS)
12 #include "ui/views/controls/image_view.h"
13 #include "ui/views/view.h"
14 #endif
16 namespace {
18 #if defined(TOOLKIT_VIEWS)
19 TEST(UiGfxImageTest, ViewsImageView) {
20 gfx::Image image(gfx::test::CreatePlatformImage());
22 scoped_ptr<views::View> container(new views::View());
23 container->SetBounds(0, 0, 200, 200);
24 container->SetVisible(true);
26 scoped_ptr<views::ImageView> image_view(new views::ImageView());
27 image_view->SetImage(*image.ToImageSkia());
28 container->AddChildView(image_view.get());
30 #endif
32 } // namespace