From c07deabcfc966cd2a5eade9bde7d826998b1a1cd Mon Sep 17 00:00:00 2001 From: Mario Bianucci Date: Wed, 29 Apr 2020 11:50:12 -0700 Subject: [PATCH] Add Blink flag and IDLs for Delegated Ink Trail Create a Blink flag to hide upcoming feature behind, and add skeleton IDLs, .cc and .h files for the feature. TL;DR of feature: Provide developers a simple JS API to improve inking latency. Latency is reduced by forwarding points from browser to GPU process more directly, and then drawing them on the swapchain just before the swap occurs, connecting them to the point most recently rendered by the app. Explainer here: https://github.com/WICG/ink-enhancement i2p: https://groups.google.com/a/chromium.org/d/msg/blink-dev/JeGBzAfR_Bw/Ppo1u7ofBgAJ Bug: 1052145 Change-Id: Ib0e1b1f6c4fbeaee551ca37770dbd72bdeeaa6b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2161932 Reviewed-by: Navid Zolghadr Reviewed-by: Daniel Libby Reviewed-by: Kentaro Hara Commit-Queue: Mario Bianucci Cr-Commit-Position: refs/heads/master@{#763903} --- ...resenter-returns-valid-promise.tentative.window.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 delegated-ink/requestPresenter-returns-valid-promise.tentative.window.js diff --git a/delegated-ink/requestPresenter-returns-valid-promise.tentative.window.js b/delegated-ink/requestPresenter-returns-valid-promise.tentative.window.js new file mode 100644 index 00000000000000..0a54115ee11ab7 --- /dev/null +++ b/delegated-ink/requestPresenter-returns-valid-promise.tentative.window.js @@ -0,0 +1,11 @@ +test(() => { + assert_implements(typeof navigator.ink !== "undefined", 'ink is not supported'); +}, "navigator needs to support ink to run this test."); + +promise_test(t => { + return promise_rejects_js(t, TypeError, navigator.ink.requestPresenter('bad-type')); +}, "Receive rejected promise for a bad type."); + +promise_test(() => { + return navigator.ink.requestPresenter('delegated-ink-trail'); +}, "Received fulfilled promise for a good type."); \ No newline at end of file