Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / tabs / media_indicator_view_unittest.mm
blobbef0bc4b956a1d4d5bf048c41cf90ab2a49b040f
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.
5 #import "chrome/browser/ui/cocoa/tabs/media_indicator_view.h"
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"
13 namespace {
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]);
22     [[test_window() contentView] addSubview:view_.get()];
24     [view_ updateIndicator:TAB_MEDIA_STATE_AUDIO_PLAYING];
25     EXPECT_EQ(TAB_MEDIA_STATE_AUDIO_PLAYING, [view_ animatingMediaState]);
26   }
28   base::scoped_nsobject<MediaIndicatorView> view_;
29   base::MessageLoopForUI message_loop_;  // Needed for gfx::Animation.
32 TEST_VIEW(MediaIndicatorViewTest, view_)
34 }  // namespace