Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/compositor-proxy-supports.html

Issue 1862453003: [Blink>TextEncoder] Removed UTF-16 support from TextEncoder API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed compositor-proxy-supports test Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/compositor-proxy-supports.html
diff --git a/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/compositor-proxy-supports.html b/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/compositor-proxy-supports.html
index a323604f07758a398637bddcd7236ed55f86be8d..5990947e7c7a9a207f5eed14fbf5b4a1ba69cb11 100644
--- a/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/compositor-proxy-supports.html
+++ b/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/compositor-proxy-supports.html
@@ -41,8 +41,17 @@ test(function() {
assert_false(proxy.supports('あ'));
// This is a hack to get a 16-bit string for a supported property.
- var transform16 = new TextDecoder('utf-16').decode(new TextEncoder('utf-16').encode('transform'));
+ var encoded = encode_utf16('transform', true);
+ var transform16 = new TextDecoder('utf-16').decode(encoded);
assert_true(transform16 === 'transform');
assert_true(proxy.supports(transform16));
}, "This test ensures that supports correctly handles queries with strings that a prefix of a property or vice versa.");
+
+function encode_utf16(s, littleEndian) {
+ var a = new Uint8Array(s.length * 2), view = new DataView(a.buffer);
+ s.split('').forEach(function(c, i) {
+ view.setUint16(i * 2, c.charCodeAt(0), littleEndian);
+ });
+ return a;
+}
</script>

Powered by Google App Engine
This is Rietveld 408576698