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

Unified Diff: chrome/browser/ui/ash/system_tray_tray_cast_browsertest_media_router_chromeos.cc

Issue 2525563003: mash: Change CastConfigDelegate to a mojoified CastConfigClient. (Closed)
Patch Set: Now for the external apitests as well. Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/system_tray_tray_cast_browsertest_media_router_chromeos.cc
diff --git a/chrome/browser/ui/ash/system_tray_tray_cast_browsertest_media_router_chromeos.cc b/chrome/browser/ui/ash/system_tray_tray_cast_browsertest_media_router_chromeos.cc
index d026e98acddf44826322b63013570a353dc273b0..21c2d893c674337ff0a0370ab6a847e8a13fe855 100644
--- a/chrome/browser/ui/ash/system_tray_tray_cast_browsertest_media_router_chromeos.cc
+++ b/chrome/browser/ui/ash/system_tray_tray_cast_browsertest_media_router_chromeos.cc
@@ -14,7 +14,7 @@
#include "chrome/browser/media/router/media_sinks_observer.h"
#include "chrome/browser/media/router/media_source_helper.h"
#include "chrome/browser/media/router/mock_media_router.h"
-#include "chrome/browser/ui/ash/cast_config_delegate_media_router.h"
+#include "chrome/browser/ui/ash/cast_config_client_media_router.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "content/public/test/test_utils.h"
#include "url/gurl.h"
@@ -82,7 +82,11 @@ class SystemTrayTrayCastMediaRouterChromeOSTest : public InProcessBrowserTest {
.WillByDefault(Invoke(
this, &SystemTrayTrayCastMediaRouterChromeOSTest::CaptureRoutes));
- CastConfigDelegateMediaRouter::SetMediaRouterForTest(&media_router_);
+ CastConfigClientMediaRouter::SetMediaRouterForTest(&media_router_);
+ }
+
+ void TearDownInProcessBrowserTestFixture() override {
+ CastConfigClientMediaRouter::SetMediaRouterForTest(nullptr);
}
media_router::MockMediaRouter media_router_;
@@ -117,20 +121,18 @@ IN_PROC_BROWSER_TEST_F(SystemTrayTrayCastMediaRouterChromeOSTest,
// The tray should be visible with any more than zero sinks.
media_sinks_observer()->OnSinksUpdated(one_sink, std::vector<GURL>());
+ content::RunAllPendingInMessageLoop();
EXPECT_TRUE(test_api.IsTrayVisible());
media_sinks_observer()->OnSinksUpdated(two_sinks, std::vector<GURL>());
+ content::RunAllPendingInMessageLoop();
EXPECT_TRUE(test_api.IsTrayVisible());
EXPECT_TRUE(test_api.IsTraySelectViewVisible());
// And if all of the sinks go away, it should be hidden again.
media_sinks_observer()->OnSinksUpdated(zero_sinks, std::vector<GURL>());
+ content::RunAllPendingInMessageLoop();
EXPECT_FALSE(test_api.IsTrayVisible());
EXPECT_FALSE(test_api.IsTraySelectViewVisible());
-
- // The CastConfigDelegate instance gets destroyed before the TrayCast
- // instance. The delegate will assert if there are still callbacks registered.
- // We need to cleanup the TrayCast callbacks to prevent the assert.
- ash::TrayCastTestAPI(GetTrayCast()).ReleaseConfigCallbacks();
}
// Verifies that we show the cast view when we start a casting session, and that
@@ -165,6 +167,7 @@ IN_PROC_BROWSER_TEST_F(SystemTrayTrayCastMediaRouterChromeOSTest,
test_api.OnCastingSessionStartedOrStopped(true /*is_casting*/);
media_routes_observer()->OnRoutesUpdated(
multiple_routes, std::vector<media_router::MediaRoute::Id>());
+ content::RunAllPendingInMessageLoop();
EXPECT_TRUE(test_api.IsTrayCastViewVisible());
EXPECT_EQ("local_route", test_api.GetDisplayedCastId());
@@ -173,6 +176,4 @@ IN_PROC_BROWSER_TEST_F(SystemTrayTrayCastMediaRouterChromeOSTest,
media_routes_observer()->OnRoutesUpdated(
no_routes, std::vector<media_router::MediaRoute::Id>());
EXPECT_FALSE(test_api.IsTrayCastViewVisible());
-
- ash::TrayCastTestAPI(GetTrayCast()).ReleaseConfigCallbacks();
}

Powered by Google App Engine
This is Rietveld 408576698