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

Unified Diff: content/browser/presentation/presentation_service_impl_unittest.cc

Issue 2972933002: [Media Router] Move main frame check for SetDefaultPresentationUrls. (Closed)
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/presentation/presentation_service_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/presentation/presentation_service_impl_unittest.cc
diff --git a/content/browser/presentation/presentation_service_impl_unittest.cc b/content/browser/presentation/presentation_service_impl_unittest.cc
index beb33bb464f997ef73975b2ab3a000fad2cc5b3a..536817a4b7e47d6db89b81857fd3e1ec0b200bb8 100644
--- a/content/browser/presentation/presentation_service_impl_unittest.cc
+++ b/content/browser/presentation/presentation_service_impl_unittest.cc
@@ -459,6 +459,23 @@ TEST_F(PresentationServiceImplTest, SetDefaultPresentationUrls) {
base::RunLoop().RunUntilIdle();
}
+TEST_F(PresentationServiceImplTest,
+ SetDefaultPresentationUrlsNoopsOnNonMainFrame) {
+ RenderFrameHost* rfh = main_rfh();
+ RenderFrameHostTester* rfh_tester = RenderFrameHostTester::For(rfh);
+ rfh = rfh_tester->AppendChild("subframe");
+
+ EXPECT_CALL(mock_delegate_, RemoveObserver(_, _)).Times(1);
+ EXPECT_CALL(mock_delegate_, AddObserver(_, _, _)).Times(1);
+ service_impl_.reset(
+ new PresentationServiceImpl(rfh, contents(), &mock_delegate_, nullptr));
+
+ EXPECT_CALL(mock_delegate_,
+ SetDefaultPresentationUrls(_, _, presentation_urls_, _))
+ .Times(0);
+ service_impl_->SetDefaultPresentationUrls(presentation_urls_);
+}
+
TEST_F(PresentationServiceImplTest, ListenForConnectionStateChange) {
PresentationInfo connection(presentation_url1_, kPresentationId);
PresentationConnectionStateChangedCallback state_changed_cb;
« no previous file with comments | « content/browser/presentation/presentation_service_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698