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

Unified Diff: content/browser/web_contents/web_contents_impl_unittest.cc

Issue 1156023006: Bring RFH/RVH unit tests closer to reality of how RF/RV are initialized (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move InitializeRenderFrameIfNeeded to RenderFrameHostTester and fix RlzLibTest code. Created 5 years, 7 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
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()) {
« no previous file with comments | « content/browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc ('k') | content/public/test/test_renderer_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698