Commit 8d7fd8f6 authored by Olivier Yiptong's avatar Olivier Yiptong Committed by Commit Bot

FontAccess: Enable Origin Trial

Enables Origin Trial for the Font Access API.

Bug: 535764
Change-Id: I257a329c3bcb52696c043eebe2d809542733f6e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2359470Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Reviewed-by: default avatarJoshua Bell <jsbell@chromium.org>
Commit-Queue: Olivier Yiptong <oyiptong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799250}
parent 0292a13f
...@@ -236,7 +236,8 @@ PermissionDescriptorPtr ParsePermissionDescriptor( ...@@ -236,7 +236,8 @@ PermissionDescriptorPtr ParsePermissionDescriptor(
return CreatePermissionDescriptor(PermissionName::WINDOW_PLACEMENT); return CreatePermissionDescriptor(PermissionName::WINDOW_PLACEMENT);
} }
if (name == "font-access") { if (name == "font-access") {
if (!RuntimeEnabledFeatures::FontAccessEnabled()) { if (!RuntimeEnabledFeatures::FontAccessEnabled(
ExecutionContext::From(script_state))) {
exception_state.ThrowTypeError("Font Access is not enabled."); exception_state.ThrowTypeError("Font Access is not enabled.");
return nullptr; return nullptr;
} }
......
...@@ -326,7 +326,6 @@ std::unique_ptr<FontPlatformData> FontCache::CreateFontPlatformData( ...@@ -326,7 +326,6 @@ std::unique_ptr<FontPlatformData> FontCache::CreateFontPlatformData(
} }
std::vector<FontEnumerationEntry> FontCache::EnumeratePlatformAvailableFonts() { std::vector<FontEnumerationEntry> FontCache::EnumeratePlatformAvailableFonts() {
DCHECK(RuntimeEnabledFeatures::FontAccessEnabled());
@autoreleasepool { @autoreleasepool {
std::vector<FontEnumerationEntry> output; std::vector<FontEnumerationEntry> output;
......
...@@ -807,6 +807,7 @@ ...@@ -807,6 +807,7 @@
}, },
{ {
name: "FontAccess", name: "FontAccess",
origin_trial_feature_name: "FontAccess",
status: "experimental", status: "experimental",
}, },
{ {
......
<!DOCTYPE html>
<meta charset="utf-8">
<!-- Generate token with the command:
generate_token.py http://127.0.0.1:8000 FontAccess --expire-timestamp=2000000000 --version 3
-->
<meta http-equiv="origin-trial" content="A/rcNz8v348b5wPno7mt9LencYF1fzEf+5oz0bbBCOBk1+8/A1KYPR5sKAWM3aPzuVrlRfdgPfRY+AxJ6sbbXA0AAABSeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiRm9udEFjY2VzcyIsICJleHBpcnkiOiAyMDAwMDAwMDAwfQ==" />
<title>Font Access API - interfaces exposed by origin trial</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/origin-trials-helper.js"></script>
<script src="/serviceworker/resources/test-helpers.js"></script>
<script>
'use strict'
test(t => {
OriginTrialsHelper.check_properties_exist(this, {
'Navigator': ['fonts'],
});
}, 'Font Access API interfaces and properties in Origin-Trial enabled document.');
test(t => {
assert_true('fonts' in navigator, 'fonts object exists on navigator scope');
assert_not_equals(navigator.fonts, undefined, 'fonts manager can be accessed on navigator');
}, 'Font Access API entry point in Origin-Trial enabled document.');
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment