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

Side by Side 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 nick'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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" 5 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/captive_portal/captive_portal_service.h" 9 #include "chrome/browser/captive_portal/captive_portal_service.h"
10 #include "chrome/browser/captive_portal/captive_portal_tab_reloader.h" 10 #include "chrome/browser/captive_portal/captive_portal_tab_reloader.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 : tab_helper_(NULL), 69 : tab_helper_(NULL),
70 mock_reloader_(new testing::StrictMock<MockCaptivePortalTabReloader>) { 70 mock_reloader_(new testing::StrictMock<MockCaptivePortalTabReloader>) {
71 tab_helper_.SetTabReloaderForTest(mock_reloader_); 71 tab_helper_.SetTabReloaderForTest(mock_reloader_);
72 } 72 }
73 ~CaptivePortalTabHelperTest() override {} 73 ~CaptivePortalTabHelperTest() override {}
74 74
75 void SetUp() override { 75 void SetUp() override {
76 ChromeRenderViewHostTestHarness::SetUp(); 76 ChromeRenderViewHostTestHarness::SetUp();
77 web_contents1_.reset(CreateTestWebContents()); 77 web_contents1_.reset(CreateTestWebContents());
78 web_contents2_.reset(CreateTestWebContents()); 78 web_contents2_.reset(CreateTestWebContents());
79 content::RenderFrameHostTester::For(main_render_frame1())
80 ->InitializeRenderFrameIfNeeded();
81 content::RenderFrameHostTester::For(main_render_frame2())
82 ->InitializeRenderFrameIfNeeded();
mmenke 2015/06/08 16:09:49 Need to include the header for RenderFrameHostTest
mmenke 2015/06/08 16:09:50 Why are these needed? What do they do? I assume
lfg 2015/06/08 17:04:01 The header is already included because of the inhe
lfg 2015/06/08 17:04:01 There are a few reasons for this, the main one is
mmenke 2015/06/08 17:15:06 Could you add some sort of comment here? It's nei
mmenke 2015/06/08 17:15:06 I'd prefer it be included explicitly - same goes f
lfg 2015/06/08 18:25:51 Done.
lfg 2015/06/08 18:25:51 Done.
79 } 83 }
80 84
81 void TearDown() override { 85 void TearDown() override {
82 web_contents2_.reset(NULL); 86 web_contents2_.reset(NULL);
83 web_contents1_.reset(NULL); 87 web_contents1_.reset(NULL);
84 ChromeRenderViewHostTestHarness::TearDown(); 88 ChromeRenderViewHostTestHarness::TearDown();
85 } 89 }
86 90
87 // Simulates a successful load of |url|. 91 // Simulates a successful load of |url|.
88 void SimulateSuccess(const GURL& url, 92 void SimulateSuccess(const GURL& url,
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 EXPECT_FALSE(tab_helper().IsLoginTab()); 643 EXPECT_FALSE(tab_helper().IsLoginTab());
640 644
641 ObservePortalResult(captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL, 645 ObservePortalResult(captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL,
642 captive_portal::RESULT_NO_RESPONSE); 646 captive_portal::RESULT_NO_RESPONSE);
643 EXPECT_FALSE(tab_helper().IsLoginTab()); 647 EXPECT_FALSE(tab_helper().IsLoginTab());
644 648
645 ObservePortalResult(captive_portal::RESULT_NO_RESPONSE, 649 ObservePortalResult(captive_portal::RESULT_NO_RESPONSE,
646 captive_portal::RESULT_INTERNET_CONNECTED); 650 captive_portal::RESULT_INTERNET_CONNECTED);
647 EXPECT_FALSE(tab_helper().IsLoginTab()); 651 EXPECT_FALSE(tab_helper().IsLoginTab());
648 } 652 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698