[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / bookmarks / bookmark_bar_folder_window_unittest.mm
blob2701dd689b42ca131592955d96d7234363a9d29e
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.
5 #include "base/mac/scoped_nsobject.h"
6 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_window.h"
7 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "testing/platform_test.h"
11 class BookmarkBarFolderWindowTest : public CocoaTest {
14 TEST_F(BookmarkBarFolderWindowTest, Borderless) {
15   base::scoped_nsobject<BookmarkBarFolderWindow> window_;
16   window_.reset([[BookmarkBarFolderWindow alloc]
17                   initWithContentRect:NSMakeRect(0,0,20,20)
18                             styleMask:0
19                               backing:NSBackingStoreBuffered
20                                 defer:NO]);
21   EXPECT_EQ(NSBorderlessWindowMask, [window_ styleMask]);
25 class BookmarkBarFolderWindowContentViewTest : public CocoaTest {
26  public:
27   BookmarkBarFolderWindowContentViewTest() {
28     view_.reset([[BookmarkBarFolderWindowContentView alloc]
29                   initWithFrame:NSMakeRect(0, 0, 100, 100)]);
30     [[test_window() contentView] addSubview:view_.get()];
31   }
32   base::scoped_nsobject<BookmarkBarFolderWindowContentView> view_;
33   base::scoped_nsobject<BookmarkBarFolderWindowScrollView> scroll_view_;
36 TEST_VIEW(BookmarkBarFolderWindowContentViewTest, view_);
39 class BookmarkBarFolderWindowScrollViewTest : public CocoaTest {
40  public:
41   BookmarkBarFolderWindowScrollViewTest() {
42     scroll_view_.reset([[BookmarkBarFolderWindowScrollView alloc]
43                   initWithFrame:NSMakeRect(0, 0, 100, 100)]);
44     [[test_window() contentView] addSubview:scroll_view_.get()];
45   }
46   base::scoped_nsobject<BookmarkBarFolderWindowScrollView> scroll_view_;
49 TEST_VIEW(BookmarkBarFolderWindowScrollViewTest, scroll_view_);