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

Unified Diff: chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc

Issue 1159143008: Fix wrong initialization of renderer_initiated_creation parameter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing mmenke@'s comments Created 5 years, 6 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: chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc
diff --git a/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc b/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc
index ce0c9c755cf48f4c2b7b64af1cfaca3f63a23740..0a9e3fd8c7a7f763a0fc2baae4d87361e0216a24 100644
--- a/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc
+++ b/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc
@@ -17,6 +17,7 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/test/test_renderer_host.h"
#include "net/base/net_errors.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -76,6 +77,14 @@ class CaptivePortalTabHelperTest : public ChromeRenderViewHostTestHarness {
ChromeRenderViewHostTestHarness::SetUp();
web_contents1_.reset(CreateTestWebContents());
web_contents2_.reset(CreateTestWebContents());
+
+ // This will simulate the initialization of the RenderFrame in the renderer
+ // process. This is needed because WebContents does not initialize a
+ // RenderFrame on construction, and the tests expect one to exist.
+ content::RenderFrameHostTester::For(main_render_frame1())
+ ->InitializeRenderFrameIfNeeded();
+ content::RenderFrameHostTester::For(main_render_frame2())
+ ->InitializeRenderFrameIfNeeded();
}
void TearDown() override {

Powered by Google App Engine
This is Rietveld 408576698