OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "base/mac/foundation_util.h" |
| 6 #include "base/mac/scoped_nsobject.h" |
| 7 #include "base/strings/utf_string_conversions.h" |
| 8 #import "testing/gtest_mac.h" |
| 9 #include "ui/app_list/views/progress_bar_view.h" |
| 10 #import "ui/events/test/cocoa_test_event_utils.h" |
| 11 #import "ui/gfx/test/ui_cocoa_test_helper.h" |
| 12 #import "ui/views_core/bridged_view_mac.h" |
| 13 #include "base/message_loop/message_loop.h" |
| 14 |
| 15 namespace app_list { |
| 16 namespace test { |
| 17 namespace { |
| 18 |
| 19 class ProgressBarViewTestMac : public ui::CocoaTest { |
| 20 public: |
| 21 ProgressBarViewTestMac() {} |
| 22 |
| 23 virtual void SetUp() OVERRIDE { |
| 24 progress_bar_.reset(new app_list::ProgressBarView()); |
| 25 progress_bar_->SetBoundsRect( |
| 26 gfx::Rect(0, 0, 80, progress_bar_->GetPreferredSize().height())); |
| 27 ui::CocoaTest::SetUp(); |
| 28 [[test_window() contentView] addSubview:progress_bar_.GetNSView()]; |
| 29 } |
| 30 |
| 31 virtual void TearDown() OVERRIDE { |
| 32 progress_bar_.reset(); |
| 33 ui::CocoaTest::TearDown(); |
| 34 } |
| 35 |
| 36 protected: |
| 37 views::BridgedView<app_list::ProgressBarView> progress_bar_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(ProgressBarViewTestMac); |
| 40 }; |
| 41 |
| 42 } // namespace |
| 43 |
| 44 TEST_VIEW(ProgressBarViewTestMac, progress_bar_.GetNSView()); |
| 45 |
| 46 TEST_F(ProgressBarViewTestMac, JustShowTheDamnThing) { |
| 47 EXPECT_TRUE([progress_bar_.GetNSView() superview]); |
| 48 |
| 49 base::MessageLoopForUI().Run(); |
| 50 } |
| 51 |
| 52 } // namespace test |
| 53 } // namespace app_list |
OLD | NEW |