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)
19 backing:NSBackingStoreBuffered
21 EXPECT_EQ(NSBorderlessWindowMask, [window_ styleMask]);
25 class BookmarkBarFolderWindowContentViewTest : public CocoaTest {
27 BookmarkBarFolderWindowContentViewTest() {
28 view_.reset([[BookmarkBarFolderWindowContentView alloc]
29 initWithFrame:NSMakeRect(0, 0, 100, 100)]);
30 [[test_window() contentView] addSubview:view_.get()];
32 base::scoped_nsobject<BookmarkBarFolderWindowContentView> view_;
33 base::scoped_nsobject<BookmarkBarFolderWindowScrollView> scroll_view_;
36 TEST_VIEW(BookmarkBarFolderWindowContentViewTest, view_);
39 class BookmarkBarFolderWindowScrollViewTest : public CocoaTest {
41 BookmarkBarFolderWindowScrollViewTest() {
42 scroll_view_.reset([[BookmarkBarFolderWindowScrollView alloc]
43 initWithFrame:NSMakeRect(0, 0, 100, 100)]);
44 [[test_window() contentView] addSubview:scroll_view_.get()];
46 base::scoped_nsobject<BookmarkBarFolderWindowScrollView> scroll_view_;
49 TEST_VIEW(BookmarkBarFolderWindowScrollViewTest, scroll_view_);