Index: ui/app_list/views/progress_bar_view_unittest_mac.mm |
diff --git a/ui/app_list/views/progress_bar_view_unittest_mac.mm b/ui/app_list/views/progress_bar_view_unittest_mac.mm |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d06b5cf899aa0521f637a1f7dfe4accad1af6209 |
--- /dev/null |
+++ b/ui/app_list/views/progress_bar_view_unittest_mac.mm |
@@ -0,0 +1,53 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "base/mac/foundation_util.h" |
+#include "base/mac/scoped_nsobject.h" |
+#include "base/strings/utf_string_conversions.h" |
+#import "testing/gtest_mac.h" |
+#include "ui/app_list/views/progress_bar_view.h" |
+#import "ui/events/test/cocoa_test_event_utils.h" |
+#import "ui/gfx/test/ui_cocoa_test_helper.h" |
+#import "ui/views_core/bridged_view_mac.h" |
+#include "base/message_loop/message_loop.h" |
+ |
+namespace app_list { |
+namespace test { |
+namespace { |
+ |
+class ProgressBarViewTestMac : public ui::CocoaTest { |
+ public: |
+ ProgressBarViewTestMac() {} |
+ |
+ virtual void SetUp() OVERRIDE { |
+ progress_bar_.reset(new app_list::ProgressBarView()); |
+ progress_bar_->SetBoundsRect( |
+ gfx::Rect(0, 0, 80, progress_bar_->GetPreferredSize().height())); |
+ ui::CocoaTest::SetUp(); |
+ [[test_window() contentView] addSubview:progress_bar_.GetNSView()]; |
+ } |
+ |
+ virtual void TearDown() OVERRIDE { |
+ progress_bar_.reset(); |
+ ui::CocoaTest::TearDown(); |
+ } |
+ |
+ protected: |
+ views::BridgedView<app_list::ProgressBarView> progress_bar_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ProgressBarViewTestMac); |
+}; |
+ |
+} // namespace |
+ |
+TEST_VIEW(ProgressBarViewTestMac, progress_bar_.GetNSView()); |
+ |
+TEST_F(ProgressBarViewTestMac, JustShowTheDamnThing) { |
+ EXPECT_TRUE([progress_bar_.GetNSView() superview]); |
+ |
+ base::MessageLoopForUI().Run(); |
+} |
+ |
+} // namespace test |
+} // namespace app_list |