#include "chrome/browser/enterprise/connectors/device_trust/device_trust_connector_service.h"
#include <utility>
#include "base/values.h"
#include "components/enterprise/device_trust/prefs.h"
#include "components/prefs/testing_pref_service.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace enterprise_connectors {
namespace {
constexpr char kExampleDomain1[] = …;
constexpr char kExampleDomain2[] = …;
constexpr char kExampleDomain3[] = …;
constexpr char kExampleDomain4[] = …;
constexpr char kExampleUrl1[] = …;
constexpr char kExampleUrl2[] = …;
constexpr char kExampleUrl3[] = …;
constexpr char kExampleUrl4[] = …;
base::Value::List GetOrigins() { … }
base::Value::List GetMoreOrigins() { … }
base::Value::List GetDifferentOrigins() { … }
void SetPolicy(TestingPrefServiceSimple* prefs,
const std::string& pref_name,
base::Value::List list = base::Value::List()) { … }
class MockPolicyObserver : public DeviceTrustConnectorService::PolicyObserver { … };
}
class DeviceTrustConnectorServiceTest : public testing::Test { … };
TEST_F(DeviceTrustConnectorServiceTest, UserPolicy_Matches_Update) { … }
TEST_F(DeviceTrustConnectorServiceTest, BrowserPolicy_Matches_Update) { … }
TEST_F(DeviceTrustConnectorServiceTest,
UserAndBrowserPolicy_SameURLsMatches_Update) { … }
TEST_F(DeviceTrustConnectorServiceTest,
UserAndBrowserPolicy_DifferentURLsMatches_Update) { … }
TEST_F(DeviceTrustConnectorServiceTest, UserPolicy_PolicyObserver_Notified) { … }
TEST_F(DeviceTrustConnectorServiceTest, BrowserPolicy_PolicyObserver_Notified) { … }
class DeviceTrustConnectorServiceFlagTest
: public DeviceTrustConnectorServiceTest,
public ::testing::WithParamInterface<bool> { … };
TEST_P(DeviceTrustConnectorServiceFlagTest,
UserPolicy_IsConnectorEnabled_Update) { … }
TEST_P(DeviceTrustConnectorServiceFlagTest,
BrowserPolicy_IsConnectorEnabled_Update) { … }
INSTANTIATE_TEST_SUITE_P(…);
}