Index: content/browser/web_contents/web_contents_impl_unittest.cc |
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc |
index b4747a550ffa31f9a95fed60032f2915d8c9c97c..fdcbdec9cb7c559556e251298cf8e11d5143b9f5 100644 |
--- a/content/browser/web_contents/web_contents_impl_unittest.cc |
+++ b/content/browser/web_contents/web_contents_impl_unittest.cc |
@@ -1689,6 +1689,7 @@ TEST_F(WebContentsImplTest, |
// Simulate the navigation to the page, that's when the interstitial gets |
// hidden. |
GURL url3("http://www.thepage.com"); |
+ contents()->GetMainFrame()->PrepareForCommit(); |
contents()->GetMainFrame()->SendNavigate(2, 0, true, url3); |
EXPECT_FALSE(contents()->ShowingInterstitialPage()); |
@@ -3023,6 +3024,9 @@ TEST_F(WebContentsImplTest, MediaPowerSaveBlocking) { |
TestRenderFrameHost* rfh = contents()->GetMainFrame(); |
AudioStateProvider* audio_state = contents()->audio_state_provider(); |
+ // Ensure RenderFrame is initialized before simulating events coming from it. |
+ main_test_rfh()->InitializeRenderFrameIfNeeded(); |
+ |
// The audio power save blocker should not be based on having a media player |
// when audio stream monitoring is available. |
if (audio_state->IsAudioStateAvailable()) { |