blob: cc7179ba179e6070b7ca12b5d43348db5d2eb8b9 [file] [log] [blame]
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_REPUTATION_SAFETY_TIP_TEST_UTILS_H_
#define CHROME_BROWSER_REPUTATION_SAFETY_TIP_TEST_UTILS_H_
#include <string>
#include <vector>
#include "chrome/browser/reputation/safety_tips.pb.h"
// Initialize component configuration. Necessary to enable Safety Tips for
// testing, as no heuristics trigger if the allowlist is inaccessible.
void InitializeSafetyTipConfig();
// Sets the patterns included in component with the given flag type for tests.
// This will replace any flag patterns currently in the proto.
void SetSafetyTipPatternsWithFlagType(
std::vector<std::string> pattern,
chrome_browser_safety_tips::FlaggedPage::FlagType type);
// Sets the patterns to trigger a bad-reputation Safety Tip for tests. This just
// calls SetSafetyTipPatternsWithFlagType with BAD_REPUTATION as the type.
void SetSafetyTipBadRepPatterns(std::vector<std::string> pattern);
// Sets allowlist patterns in the given proto for testing. This will replace any
// allowlist patterns currently in the proto.
// |patterns| is the list of hostnames allowed to be lookalikes.
// |target_patterns| is the list of hostname regexes allowed to be targets of
// lookalikes.
void SetSafetyTipAllowlistPatterns(std::vector<std::string> patterns,
std::vector<std::string> target_patterns);
#endif // CHROME_BROWSER_REPUTATION_SAFETY_TIP_TEST_UTILS_H_