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 7829b5aaba29b321f6b0d20c081efa1ebb8d2b94..c2d818967faf917aeb970db22a221d927a004347 100644 |
--- a/content/browser/web_contents/web_contents_impl_unittest.cc |
+++ b/content/browser/web_contents/web_contents_impl_unittest.cc |
@@ -1681,6 +1681,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()); |
@@ -3015,6 +3016,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()) { |