#include <memory>
#include "base/feature_list.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/chrome_test_utils.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/search_test_utils.h"
#include "components/search_engines/template_url_data.h"
#include "components/search_engines/template_url_service.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_mock_cert_verifier.h"
#include "content/public/test/prerender_test_util.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "url/gurl.h"
namespace {
BasicHttpResponse;
HttpRequest;
HttpResponse;
constexpr static char kSearchDomain[] = …;
constexpr static char kSuggestionDomain[] = …;
constexpr static char16_t kSearchDomain16[] = …;
BASE_FEATURE(…);
std::unique_ptr<HttpResponse> ReturnOKResponseForAllRequests(
const HttpRequest& request) { … }
}
class LatencyAblationBrowserTest : public InProcessBrowserTest { … };
IN_PROC_BROWSER_TEST_F(LatencyAblationBrowserTest, DenyIPAddress) { … }
class LatencyAblationDisabledBrowserTest : public LatencyAblationBrowserTest { … };
IN_PROC_BROWSER_TEST_F(LatencyAblationDisabledBrowserTest, DenyIPAddress) { … }
class LatencyAblationEnabledBrowserTest : public LatencyAblationBrowserTest { … };
IN_PROC_BROWSER_TEST_F(LatencyAblationEnabledBrowserTest, DontAblateIPAddress) { … }
IN_PROC_BROWSER_TEST_F(LatencyAblationEnabledBrowserTest, DontAblatePrerender) { … }
IN_PROC_BROWSER_TEST_F(LatencyAblationEnabledBrowserTest, AblateNonSearch) { … }
IN_PROC_BROWSER_TEST_F(LatencyAblationEnabledBrowserTest, AblateSearchHost) { … }
IN_PROC_BROWSER_TEST_F(LatencyAblationEnabledBrowserTest,
AblateSearchRealtedHost) { … }
IN_PROC_BROWSER_TEST_F(LatencyAblationEnabledBrowserTest, AblateSearchQuery) { … }
class LatencyAblationEnabledSearchQueryDisabledBrowserTest
: public LatencyAblationBrowserTest { … };
IN_PROC_BROWSER_TEST_F(LatencyAblationEnabledSearchQueryDisabledBrowserTest,
AblateNonSearch) { … }
IN_PROC_BROWSER_TEST_F(LatencyAblationEnabledSearchQueryDisabledBrowserTest,
AblateSearchHost) { … }
IN_PROC_BROWSER_TEST_F(LatencyAblationEnabledSearchQueryDisabledBrowserTest,
AblateSearchRealtedHost) { … }
IN_PROC_BROWSER_TEST_F(LatencyAblationEnabledSearchQueryDisabledBrowserTest,
DoNotAblateSearchQuery) { … }
class LatencyAblationEnabledSearchHostDisabledBrowserTest
: public LatencyAblationBrowserTest { … };
IN_PROC_BROWSER_TEST_F(LatencyAblationEnabledSearchHostDisabledBrowserTest,
AblateNonSearch) { … }
IN_PROC_BROWSER_TEST_F(LatencyAblationEnabledSearchHostDisabledBrowserTest,
DoNotAblateSearchHost) { … }
IN_PROC_BROWSER_TEST_F(LatencyAblationEnabledSearchHostDisabledBrowserTest,
DoNotAblateSearchRealtedHost) { … }
IN_PROC_BROWSER_TEST_F(LatencyAblationEnabledSearchHostDisabledBrowserTest,
AblateSearchQuery) { … }
class LatencyAblationEnabledNonSearchDisabledBrowserTest
: public LatencyAblationBrowserTest { … };
IN_PROC_BROWSER_TEST_F(LatencyAblationEnabledNonSearchDisabledBrowserTest,
DoNotAblateNonSearch) { … }
IN_PROC_BROWSER_TEST_F(LatencyAblationEnabledNonSearchDisabledBrowserTest,
DoNotAblateSearchHost) { … }
IN_PROC_BROWSER_TEST_F(LatencyAblationEnabledNonSearchDisabledBrowserTest,
AblateSearchRealtedHost) { … }
IN_PROC_BROWSER_TEST_F(LatencyAblationEnabledNonSearchDisabledBrowserTest,
AblateSearchQuery) { … }
class LatencyAblationEnabledPatternBrowserTest
: public LatencyAblationBrowserTest { … };
IN_PROC_BROWSER_TEST_F(LatencyAblationEnabledPatternBrowserTest,
AblatePattern) { … }
IN_PROC_BROWSER_TEST_F(LatencyAblationEnabledPatternBrowserTest,
DoNotAblateIfNotMatch) { … }