summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/loader/resource/font_resource_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/core/loader/resource/font_resource_test.cc')
-rw-r--r--chromium/third_party/blink/renderer/core/loader/resource/font_resource_test.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/chromium/third_party/blink/renderer/core/loader/resource/font_resource_test.cc b/chromium/third_party/blink/renderer/core/loader/resource/font_resource_test.cc
index 7a5e062b7f7..d67532f2701 100644
--- a/chromium/third_party/blink/renderer/core/loader/resource/font_resource_test.cc
+++ b/chromium/third_party/blink/renderer/core/loader/resource/font_resource_test.cc
@@ -71,7 +71,7 @@ TEST_F(FontResourceTest,
// Fetch to cache a resource.
ResourceRequest request1(url);
- FetchParameters fetch_params1(request1);
+ FetchParameters fetch_params1(std::move(request1));
Resource* resource1 = FontResource::Fetch(fetch_params1, fetcher, nullptr);
ASSERT_FALSE(resource1->ErrorOccurred());
fetcher->StartLoad(resource1);
@@ -85,7 +85,7 @@ TEST_F(FontResourceTest,
// Revalidate the resource.
ResourceRequest request2(url);
request2.SetCacheMode(mojom::FetchCacheMode::kValidateCache);
- FetchParameters fetch_params2(request2);
+ FetchParameters fetch_params2(std::move(request2));
Resource* resource2 = FontResource::Fetch(fetch_params2, fetcher, nullptr);
ASSERT_FALSE(resource2->ErrorOccurred());
EXPECT_EQ(resource1, resource2);
@@ -95,7 +95,7 @@ TEST_F(FontResourceTest,
// Fetch the same resource again before actual load operation starts.
ResourceRequest request3(url);
request3.SetCacheMode(mojom::FetchCacheMode::kValidateCache);
- FetchParameters fetch_params3(request3);
+ FetchParameters fetch_params3(std::move(request3));
Resource* resource3 = FontResource::Fetch(fetch_params3, fetcher, nullptr);
ASSERT_FALSE(resource3->ErrorOccurred());
EXPECT_EQ(resource2, resource3);
@@ -130,7 +130,7 @@ TEST_F(CacheAwareFontResourceTest, CacheAwareFontLoading) {
CSSFontFaceSrcValue* src_value = CSSFontFaceSrcValue::Create(
url.GetString(), url.GetString(),
Referrer(document.Url(), document.GetReferrerPolicy()),
- kDoNotCheckContentSecurityPolicy, OriginClean::kTrue);
+ network::mojom::CSPDisposition::DO_NOT_CHECK, OriginClean::kTrue);
// Route font requests in this test through CSSFontFaceSrcValue::Fetch
// instead of calling FontResource::Fetch directly. CSSFontFaceSrcValue
@@ -140,11 +140,12 @@ TEST_F(CacheAwareFontResourceTest, CacheAwareFontLoading) {
// a "cache hit" in ResourceFetcher's view.
Persistent<MockFontResourceClient> client =
MakeGarbageCollected<MockFontResourceClient>();
- FontResource& resource = src_value->Fetch(&document, client);
+ FontResource& resource =
+ src_value->Fetch(document.ToExecutionContext(), client);
fetcher->StartLoad(&resource);
EXPECT_TRUE(resource.Loader()->IsCacheAwareLoadingActivated());
- resource.load_limit_state_ = FontResource::kUnderLimit;
+ resource.load_limit_state_ = FontResource::LoadLimitState::kUnderLimit;
// FontResource callbacks should be blocked during cache-aware loading.
resource.FontLoadShortLimitCallback();
@@ -162,7 +163,8 @@ TEST_F(CacheAwareFontResourceTest, CacheAwareFontLoading) {
// Add client now, FontLoadShortLimitExceeded() should be called.
Persistent<MockFontResourceClient> client2 =
MakeGarbageCollected<MockFontResourceClient>();
- FontResource& resource2 = src_value->Fetch(&document, client2);
+ FontResource& resource2 =
+ src_value->Fetch(document.ToExecutionContext(), client2);
EXPECT_EQ(&resource, &resource2);
EXPECT_TRUE(client2->FontLoadShortLimitExceededCalled());
EXPECT_FALSE(client2->FontLoadLongLimitExceededCalled());
@@ -174,7 +176,8 @@ TEST_F(CacheAwareFontResourceTest, CacheAwareFontLoading) {
// Add client now, both callbacks should be called.
Persistent<MockFontResourceClient> client3 =
MakeGarbageCollected<MockFontResourceClient>();
- FontResource& resource3 = src_value->Fetch(&document, client3);
+ FontResource& resource3 =
+ src_value->Fetch(document.ToExecutionContext(), client3);
EXPECT_EQ(&resource, &resource3);
EXPECT_TRUE(client3->FontLoadShortLimitExceededCalled());
EXPECT_TRUE(client3->FontLoadLongLimitExceededCalled());