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

Unified Diff: content/browser/media/session/media_session_impl_service_routing_unittest.cc

Issue 2733843003: Fix a crash when receiving PAUSE action but no service is routed (Closed)
Patch Set: addressed comments Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/media/session/media_session_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/session/media_session_impl_service_routing_unittest.cc
diff --git a/content/browser/media/session/media_session_impl_service_routing_unittest.cc b/content/browser/media/session/media_session_impl_service_routing_unittest.cc
index ff969be22f82f8a2087d93a39661b1d92d4cf39f..2aa4d8443d86a13a37a4f4809726c97e147fc487 100644
--- a/content/browser/media/session/media_session_impl_service_routing_unittest.cc
+++ b/content/browser/media/session/media_session_impl_service_routing_unittest.cc
@@ -402,4 +402,16 @@ TEST_F(MediaSessionImplServiceRoutingTest,
run_loop.Run();
}
+TEST_F(MediaSessionImplServiceRoutingTest,
+ TestReceivingPauseActionWhenNoServiceRouted) {
+ CreateServiceForFrame(main_frame_);
+ CreateServiceForFrame(sub_frame_);
+
+ EXPECT_EQ(nullptr, ComputeServiceForRouting());
+
+ // This should not crash.
+ MediaSessionImpl::Get(contents())
+ ->DidReceiveAction(blink::mojom::MediaSessionAction::PAUSE);
+}
+
} // namespace content
« no previous file with comments | « content/browser/media/session/media_session_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698