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

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: Add workaround to <webview> bug (492830) 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 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()) {

Powered by Google App Engine
This is Rietveld 408576698