| // Copyright 2022 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #include "components/aggregation_service/parsing_utils.h" |
| #include "components/aggregation_service/aggregation_coordinator_utils.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| namespace aggregation_service { |
| TEST(AggregationServiceParsingUtilsTest, ParseAggregationCoordinator) { |
| ScopedAggregationCoordinatorAllowlistForTesting scoped_coordinator_allowlist( |
| {url::Origin::Create(GURL("https://b.test"))}); |
| std::optional<url::Origin> expected; |
| {"https://b.test", url::Origin::Create(GURL("https://b.test"))}, |
| {"https://a.test", std::nullopt}, |
| for (const auto& test_case : kTestCases) { |
| EXPECT_EQ(ParseAggregationCoordinator(test_case.str), test_case.expected) |
| } // namespace aggregation_service |