#include "components/captive_portal/content/captive_portal_tab_helper.h"
#include <memory>
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "components/captive_portal/content/captive_portal_service.h"
#include "components/captive_portal/content/captive_portal_tab_reloader.h"
#include "components/embedder_support/pref_names.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/testing_pref_service.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_renderer_host.h"
#include "content/public/test/test_utils.h"
#include "content/public/test/web_contents_tester.h"
#include "net/base/net_errors.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
NavigationSimulator;
namespace captive_portal {
namespace {
const char* const kStartUrl = …;
const char* const kHttpUrl = …;
const char* const kHttpsUrl = …;
const char* const kHttpsUrl2 = …;
}
class MockCaptivePortalTabReloader : public CaptivePortalTabReloader { … };
class CaptivePortalTabHelperTest : public content::RenderViewHostTestHarness { … };
TEST_F(CaptivePortalTabHelperTest, HttpSuccess) { … }
TEST_F(CaptivePortalTabHelperTest, HttpTimeout) { … }
TEST_F(CaptivePortalTabHelperTest, HttpsSuccess) { … }
TEST_F(CaptivePortalTabHelperTest, HttpsTimeout) { … }
TEST_F(CaptivePortalTabHelperTest, HttpsSecureDnsNetworkError) { … }
TEST_F(CaptivePortalTabHelperTest, HttpsAbort) { … }
TEST_F(CaptivePortalTabHelperTest, AbortCrossProcess) { … }
TEST_F(CaptivePortalTabHelperTest, HttpsAbortTimeout) { … }
TEST_F(CaptivePortalTabHelperTest, AbortTimeoutCrossProcess) { … }
TEST_F(CaptivePortalTabHelperTest, HttpsAbortTimeoutForCrossProcess) { … }
TEST_F(CaptivePortalTabHelperTest, UnexpectedProvisionalLoad) { … }
TEST_F(CaptivePortalTabHelperTest, UnexpectedCommit) { … }
TEST_F(CaptivePortalTabHelperTest, HttpsSubframe) { … }
TEST_F(CaptivePortalTabHelperTest, HttpsSubframeParallelError) { … }
TEST_F(CaptivePortalTabHelperTest, HttpToHttpsRedirectTimeout) { … }
TEST_F(CaptivePortalTabHelperTest, HttpsToHttpRedirect) { … }
TEST_F(CaptivePortalTabHelperTest, HttpToHttpRedirect) { … }
TEST_F(CaptivePortalTabHelperTest, SubframeRedirect) { … }
TEST_F(CaptivePortalTabHelperTest, LoginTabLogin) { … }
TEST_F(CaptivePortalTabHelperTest, LoginTabError) { … }
TEST_F(CaptivePortalTabHelperTest, LoginTabMultipleResultsBeforeLogin) { … }
TEST_F(CaptivePortalTabHelperTest, NoLoginTab) { … }
}