summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/tests/ui_gfx_image_unittest.cc
blob: c226cc1abf8028e64fcc7174fe4c4d4b5b109ff8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/memory/scoped_ptr.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_unittest_util.h"

#if defined(TOOLKIT_VIEWS)
#include "ui/views/controls/image_view.h"
#include "ui/views/view.h"
#endif

namespace {

#if defined(TOOLKIT_VIEWS)
TEST(UiGfxImageTest, ViewsImageView) {
  gfx::Image image(gfx::test::CreatePlatformImage());

  scoped_ptr<views::View> container(new views::View());
  container->SetBounds(0, 0, 200, 200);
  container->SetVisible(true);

  scoped_ptr<views::ImageView> image_view(new views::ImageView());
  image_view->SetImage(*image.ToImageSkia());
  container->AddChildView(image_view.get());
}
#endif

}  // namespace