blob: d28514e12a8e5b53f2d63fa05d1d1e2bcdb67c09 [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.
void SetSafetyTipAllowlistPatterns(std::vector<std::string> patterns);
#endif // CHROME_BROWSER_REPUTATION_SAFETY_TIP_TEST_UTILS_H_