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 #import "chrome/browser/ui/cocoa/tabs/media_indicator_view.h" | |
6 | |
7 #include "base/mac/scoped_nsobject.h" | |
8 #include "base/message_loop/message_loop.h" | |
9 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | |
10 #include "testing/gtest/include/gtest/gtest.h" | |
11 #include "testing/platform_test.h" | |
12 | |
13 namespace { | |
14 | |
15 class MediaIndicatorViewTest : public CocoaTest { | |
16 public: | |
17 MediaIndicatorViewTest() { | |
18 view_.reset([[MediaIndicatorView alloc] init]); | |
19 EXPECT_TRUE(view_ != nil); | |
20 EXPECT_EQ(TAB_MEDIA_STATE_NONE, [view_ animatingMediaState]); | |
21 | |
22 [[test_window() contentView] addSubview:view_.get()]; | |
23 | |
24 [view_ updateIndicator:TAB_MEDIA_STATE_AUDIO_PLAYING]; | |
25 EXPECT_EQ(TAB_MEDIA_STATE_AUDIO_PLAYING, [view_ animatingMediaState]); | |
26 } | |
27 | |
28 base::scoped_nsobject<MediaIndicatorView> view_; | |
29 base::MessageLoopForUI message_loop_; // Needed for gfx::Animation. | |
30 }; | |
31 | |
32 TEST_VIEW(MediaIndicatorViewTest, view_) | |
33 | |
34 } // namespace | |
OLD | NEW |