#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "components/prefs/testing_pref_service.h"
#include "components/web_resource/eula_accepted_notifier.h"
#include "components/web_resource/resource_request_allowed_notifier_test_util.h"
#include "services/network/test/test_network_connection_tracker.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace web_resource {
class TestEulaAcceptedNotifier : public EulaAcceptedNotifier { … };
enum class ConnectionTrackerResponseMode { … };
class ResourceRequestAllowedNotifierBaseTest
: public testing::Test,
public ResourceRequestAllowedNotifier::Observer,
public testing::WithParamInterface<ConnectionTrackerResponseMode> { … };
class ResourceRequestAllowedNotifierTest
: public ResourceRequestAllowedNotifierBaseTest { … };
class ResourceRequestAllowedNotifierNoEulaTest
: public ResourceRequestAllowedNotifierBaseTest { … };
TEST_P(ResourceRequestAllowedNotifierTest, NotifyOnInitialNetworkState) { … }
TEST_P(ResourceRequestAllowedNotifierTest, DoNotNotifyIfOffline) { … }
TEST_P(ResourceRequestAllowedNotifierTest, DoNotNotifyIfOnlineToOnline) { … }
TEST_P(ResourceRequestAllowedNotifierTest, NotifyOnReconnect) { … }
TEST_P(ResourceRequestAllowedNotifierTest, NoNotifyOnWardriving) { … }
TEST_P(ResourceRequestAllowedNotifierTest, NoNotifyOnFlakyConnection) { … }
TEST_P(ResourceRequestAllowedNotifierTest, NotifyOnFlakyConnection) { … }
TEST_P(ResourceRequestAllowedNotifierTest, NoNotifyOnEulaAfterGoOffline) { … }
TEST_P(ResourceRequestAllowedNotifierTest, NoRequestNoNotify) { … }
TEST_P(ResourceRequestAllowedNotifierTest, EulaOnlyNetworkOffline) { … }
TEST_P(ResourceRequestAllowedNotifierTest, EulaFirst) { … }
TEST_P(ResourceRequestAllowedNotifierTest, NetworkFirst) { … }
TEST_P(ResourceRequestAllowedNotifierTest, NoRequestNoNotifyEula) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(ResourceRequestAllowedNotifierNoEulaTest, NetworkNotification) { … }
INSTANTIATE_TEST_SUITE_P(…);
}