| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/subresource_filter/core/common/first_party_origin.h" | 5 #include "components/subresource_filter/core/common/first_party_origin.h" |
| 6 | 6 |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace subresource_filter { | 10 namespace subresource_filter { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 | 67 |
| 68 TEST(FirstPartyOriginTest, EmptyHostUrls) { | 68 TEST(FirstPartyOriginTest, EmptyHostUrls) { |
| 69 const char* const kUrls[] = { | 69 const char* const kUrls[] = { |
| 70 "data:text/plain,example.com", "data:text/plain,another.example.com", | 70 "data:text/plain,example.com", "data:text/plain,another.example.com", |
| 71 "data:text/plain;base64,ABACABA", | 71 "data:text/plain;base64,ABACABA", |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 FirstPartyOrigin first_party(url::Origin(GURL("https://example.com"))); | 74 FirstPartyOrigin first_party(url::Origin(GURL("https://example.com"))); |
| 75 for (const auto& url_string : kUrls) { | 75 for (auto* url_string : kUrls) { |
| 76 GURL url(url_string); | 76 GURL url(url_string); |
| 77 EXPECT_TRUE(FirstPartyOrigin::IsThirdParty(url, first_party.origin())); | 77 EXPECT_TRUE(FirstPartyOrigin::IsThirdParty(url, first_party.origin())); |
| 78 EXPECT_TRUE(first_party.IsThirdParty(url)); | 78 EXPECT_TRUE(first_party.IsThirdParty(url)); |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 | 81 |
| 82 } // namespace subresource_filter | 82 } // namespace subresource_filter |
| OLD | NEW |