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

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

Issue 1151973005: 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: Fix IsRenderFrameLive to be independent of RenderViewHost. 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 6a3f6e0174b949bada94f2ccaa9143302a8d9fa3..3dd0a006df769d86745b80e6733c8b96fc4663e1 100644
--- a/content/browser/web_contents/web_contents_impl_unittest.cc
+++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -1894,9 +1894,6 @@ TEST_F(WebContentsImplTest, ShowInterstitialCrashRendererThenGoBack) {
// While the interstitial is showing, go back.
controller().GoBack();
- main_test_rfh()->PrepareForCommit();
- contents()->GetMainFrame()->SendNavigate(1, entry->GetUniqueID(), false,
- url1);
ncarter (slow) 2015/05/26 21:44:14 What's the story with the lines that were removed
nasko 2015/05/26 22:25:49 This might belong to a separate CL. It is incorrec
// Make sure we are back to the original page and that the interstitial is
// gone.
@@ -3016,6 +3013,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()) {

Powered by Google App Engine
This is Rietveld 408576698