Home | History | Annotate | Download | only in bookmarks
      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/memory/scoped_ptr.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"
     10 
     11 class BookmarkBarFolderWindowTest : public CocoaTest {
     12 };
     13 
     14 TEST_F(BookmarkBarFolderWindowTest, Borderless) {
     15   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]);
     22 }
     23 
     24 
     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   scoped_nsobject<BookmarkBarFolderWindowContentView> view_;
     33   scoped_nsobject<BookmarkBarFolderWindowScrollView> scroll_view_;
     34 };
     35 
     36 TEST_VIEW(BookmarkBarFolderWindowContentViewTest, view_);
     37 
     38 
     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   scoped_nsobject<BookmarkBarFolderWindowScrollView> scroll_view_;
     47 };
     48 
     49 TEST_VIEW(BookmarkBarFolderWindowScrollViewTest, scroll_view_);
     50