chromium/chrome/browser/ui/passwords/well_known_change_password_navigation_throttle_unittest.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/passwords/well_known_change_password_navigation_throttle.h"

#include <optional>

#include "base/memory/raw_ptr.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "components/variations/scoped_variations_ids_provider.h"
#include "content/public/browser/navigation_throttle.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/test/mock_navigation_handle.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_renderer_host.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "ui/base/page_transition_types.h"
#include "url/gurl.h"
#include "url/origin.h"

namespace {

// An option struct to simplify setting up a specific navigation throttle.
struct NavigationThrottleOptions {};

}  // namespace

class WellKnownChangePasswordNavigationThrottleTest
    : public ChromeRenderViewHostTestHarness {};

TEST_F(WellKnownChangePasswordNavigationThrottleTest,
       CreateNavigationThrottle_ChangePasswordUrl) {}

TEST_F(WellKnownChangePasswordNavigationThrottleTest,
       CreateNavigationThrottle_ChangePasswordUrl_FromGoogleLink) {}

TEST_F(WellKnownChangePasswordNavigationThrottleTest,
       NeverCreateNavigationThrottle_FromOtherLink) {}

TEST_F(WellKnownChangePasswordNavigationThrottleTest,
       NeverCreateNavigationThrottle_DifferentUrl) {}

// A WellKnownChangePasswordNavigationThrottle should never be created for a
// navigation initiated by a subframe.
TEST_F(WellKnownChangePasswordNavigationThrottleTest,
       NeverCreateNavigationThrottle_Subframe) {}

class WellKnownChangePasswordNavigationThrottleFencedFramesTest
    : public WellKnownChangePasswordNavigationThrottleTest {};

// A WellKnownChangePasswordNavigationThrottle should never be created for a
// navigation initiated by a fenced frame.
TEST_F(WellKnownChangePasswordNavigationThrottleFencedFramesTest,
       NeverCreateNavigationThrottle_FencedFrame) {}