- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / cocoa / infobars / infobar_gradient_view_unittest.mm
1 // Copyright (c) 2011 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.
4
5 #include "base/mac/scoped_nsobject.h"
6 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
7 #import "chrome/browser/ui/cocoa/infobars/infobar_gradient_view.h"
8
9 namespace {
10
11 class InfoBarGradientViewTest : public CocoaTest {
12  public:
13   InfoBarGradientViewTest() {
14     NSRect frame = NSMakeRect(0, 0, 100, 30);
15     base::scoped_nsobject<InfoBarGradientView> view(
16         [[InfoBarGradientView alloc] initWithFrame:frame]);
17     view_ = view.get();
18     [[test_window() contentView] addSubview:view_];
19   }
20
21   InfoBarGradientView* view_;  // Weak. Retained by view hierarchy.
22 };
23
24 TEST_VIEW(InfoBarGradientViewTest, view_);
25
26 // Assert that the view is non-opaque, because otherwise we will end
27 // up with findbar painting issues.
28 TEST_F(InfoBarGradientViewTest, AssertViewNonOpaque) {
29   EXPECT_FALSE([view_ isOpaque]);
30 }
31
32 }  // namespace