mirror of
https://github.com/servo/servo.git
synced 2025-10-17 08:49:21 +01:00
Update web-platform-tests to revision b'b728032f59a396243864b0f8584e7211e3632005'
This commit is contained in:
parent
ace9b32b1c
commit
df68c4e5d1
15632 changed files with 514865 additions and 155000 deletions
|
@ -0,0 +1,29 @@
|
|||
importScripts('/resources/testharness.js');
|
||||
importScripts('resources/sync-access-handle-test.js');
|
||||
|
||||
'use strict';
|
||||
|
||||
sync_access_handle_test((t, handle) => {
|
||||
handle.flush();
|
||||
}, 'Test flush on an empty file.');
|
||||
|
||||
sync_access_handle_test((t, handle) => {
|
||||
if (!('TextEncoder' in self)) {
|
||||
return;
|
||||
}
|
||||
const encoder = new TextEncoder();
|
||||
const decoder = new TextDecoder();
|
||||
|
||||
const text = 'Hello Storage Foundation';
|
||||
const writeBuffer = new TextEncoder().encode(text);
|
||||
handle.write(writeBuffer, {at: 0});
|
||||
handle.flush();
|
||||
let readBuffer = new Uint8Array(text.length);
|
||||
handle.read(readBuffer, {at: 0});
|
||||
assert_equals(
|
||||
text, new TextDecoder().decode(readBuffer),
|
||||
'Check that the written bytes and the read bytes match');
|
||||
}, 'SyncAccessHandle.read returns bytes written by SyncAccessHandle.write' +
|
||||
' after SyncAccessHandle.flush');
|
||||
|
||||
done();
|
Loading…
Add table
Add a link
Reference in a new issue