Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: chrome/browser/ui/ash/system_tray_tray_cast_browsertest_media_router_chromeos.cc

Issue 2957983002: Remove pointless InProcessBrowserTest calls. (Closed)
Patch Set: build Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <vector> 5 #include <vector>
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/tray/system_tray.h" 8 #include "ash/system/tray/system_tray.h"
9 #include "ash/system/tray/system_tray_delegate.h" 9 #include "ash/system/tray/system_tray_delegate.h"
10 #include "ash/system/tray/system_tray_test_api.h" 10 #include "ash/system/tray/system_tray_test_api.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 bool CaptureSink(media_router::MediaSinksObserver* media_sinks_observer) { 69 bool CaptureSink(media_router::MediaSinksObserver* media_sinks_observer) {
70 media_sinks_observer_ = media_sinks_observer; 70 media_sinks_observer_ = media_sinks_observer;
71 return true; 71 return true;
72 } 72 }
73 73
74 void CaptureRoutes(media_router::MediaRoutesObserver* media_routes_observer) { 74 void CaptureRoutes(media_router::MediaRoutesObserver* media_routes_observer) {
75 media_routes_observer_ = media_routes_observer; 75 media_routes_observer_ = media_routes_observer;
76 } 76 }
77 77
78 void SetUpInProcessBrowserTestFixture() override { 78 void SetUpInProcessBrowserTestFixture() override {
79 InProcessBrowserTest::SetUpInProcessBrowserTestFixture();
80
81 ON_CALL(media_router_, RegisterMediaSinksObserver(_)) 79 ON_CALL(media_router_, RegisterMediaSinksObserver(_))
82 .WillByDefault(Invoke( 80 .WillByDefault(Invoke(
83 this, &SystemTrayTrayCastMediaRouterChromeOSTest::CaptureSink)); 81 this, &SystemTrayTrayCastMediaRouterChromeOSTest::CaptureSink));
84 ON_CALL(media_router_, RegisterMediaRoutesObserver(_)) 82 ON_CALL(media_router_, RegisterMediaRoutesObserver(_))
85 .WillByDefault(Invoke( 83 .WillByDefault(Invoke(
86 this, &SystemTrayTrayCastMediaRouterChromeOSTest::CaptureRoutes)); 84 this, &SystemTrayTrayCastMediaRouterChromeOSTest::CaptureRoutes));
87 CastConfigClientMediaRouter::SetMediaRouterForTest(&media_router_); 85 CastConfigClientMediaRouter::SetMediaRouterForTest(&media_router_);
88 } 86 }
89 87
90 void TearDownInProcessBrowserTestFixture() override { 88 void TearDownInProcessBrowserTestFixture() override {
91 CastConfigClientMediaRouter::SetMediaRouterForTest(nullptr); 89 CastConfigClientMediaRouter::SetMediaRouterForTest(nullptr);
92 InProcessBrowserTest::TearDownInProcessBrowserTestFixture();
93 } 90 }
94 91
95 media_router::MockMediaRouter media_router_; 92 media_router::MockMediaRouter media_router_;
96 media_router::MediaSinksObserver* media_sinks_observer_ = nullptr; 93 media_router::MediaSinksObserver* media_sinks_observer_ = nullptr;
97 media_router::MediaRoutesObserver* media_routes_observer_ = nullptr; 94 media_router::MediaRoutesObserver* media_routes_observer_ = nullptr;
98 95
99 DISALLOW_COPY_AND_ASSIGN(SystemTrayTrayCastMediaRouterChromeOSTest); 96 DISALLOW_COPY_AND_ASSIGN(SystemTrayTrayCastMediaRouterChromeOSTest);
100 }; 97 };
101 98
102 } // namespace 99 } // namespace
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 EXPECT_TRUE(test_api.IsTrayCastViewVisible()); 182 EXPECT_TRUE(test_api.IsTrayCastViewVisible());
186 EXPECT_EQ("local_route", test_api.GetDisplayedCastId()); 183 EXPECT_EQ("local_route", test_api.GetDisplayedCastId());
187 184
188 // When a casting session stops, we shouldn't display the cast view. 185 // When a casting session stops, we shouldn't display the cast view.
189 test_api.OnCastingSessionStartedOrStopped(false /*is_casting*/); 186 test_api.OnCastingSessionStartedOrStopped(false /*is_casting*/);
190 media_routes_observer()->OnRoutesUpdated( 187 media_routes_observer()->OnRoutesUpdated(
191 no_routes, std::vector<media_router::MediaRoute::Id>()); 188 no_routes, std::vector<media_router::MediaRoute::Id>());
192 content::RunAllPendingInMessageLoop(); 189 content::RunAllPendingInMessageLoop();
193 EXPECT_FALSE(test_api.IsTrayCastViewVisible()); 190 EXPECT_FALSE(test_api.IsTrayCastViewVisible());
194 } 191 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698