[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / omnibox / omnibox_popup_separator_view_unittest.mm
blob85149a3503e10e883a969bea9e7be454c43b0a32
1 // Copyright 2013 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 #import "chrome/browser/ui/cocoa/omnibox/omnibox_popup_separator_view.h"
7 #include "base/mac/scoped_nsobject.h"
8 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
10 class OmniboxPopupBottomSeparatorViewTest : public CocoaTest {
11  public:
12   OmniboxPopupBottomSeparatorViewTest() {
13     NSView* contentView = [test_window() contentView];
14     bottom_view_.reset([[OmniboxPopupBottomSeparatorView alloc]
15         initWithFrame:[contentView bounds]]);
16     [contentView addSubview:bottom_view_];
17   }
19  protected:
20   base::scoped_nsobject<OmniboxPopupBottomSeparatorView> bottom_view_;
22  private:
23   DISALLOW_COPY_AND_ASSIGN(OmniboxPopupBottomSeparatorViewTest);
26 TEST_VIEW(OmniboxPopupBottomSeparatorViewTest, bottom_view_);
28 TEST_F(OmniboxPopupBottomSeparatorViewTest, PreferredHeight) {
29   EXPECT_LT(0, [OmniboxPopupBottomSeparatorView preferredHeight]);
32 class OmniboxPopupTopSeparatorViewTest : public CocoaTest {
33  public:
34   OmniboxPopupTopSeparatorViewTest() {
35     NSView* contentView = [test_window() contentView];
36     top_view_.reset([[OmniboxPopupTopSeparatorView alloc]
37         initWithFrame:[contentView bounds]]);
38     [contentView addSubview:top_view_];
39   }
41  protected:
42   base::scoped_nsobject<OmniboxPopupTopSeparatorView> top_view_;
44  private:
45   DISALLOW_COPY_AND_ASSIGN(OmniboxPopupTopSeparatorViewTest);
48 TEST_VIEW(OmniboxPopupTopSeparatorViewTest, top_view_);
50 TEST_F(OmniboxPopupTopSeparatorViewTest, PreferredHeight) {
51   EXPECT_LT(0, [OmniboxPopupTopSeparatorView preferredHeight]);