11cb0ef41Sopenharmony_ci<!DOCTYPE html> 21cb0ef41Sopenharmony_ci<meta charset="utf-8"> 31cb0ef41Sopenharmony_ci<title>FileAPI Test: filereader_readAsBinaryString</title> 41cb0ef41Sopenharmony_ci<link rel="author" title="Intel" href="http://www.intel.com"> 51cb0ef41Sopenharmony_ci<link rel="help" href="https://w3c.github.io/FileAPI/#readAsBinaryString"> 61cb0ef41Sopenharmony_ci<script src="/resources/testharness.js"></script> 71cb0ef41Sopenharmony_ci<script src="/resources/testharnessreport.js"></script> 81cb0ef41Sopenharmony_ci<script> 91cb0ef41Sopenharmony_ci 101cb0ef41Sopenharmony_ciasync_test(t => { 111cb0ef41Sopenharmony_ci const blob = new Blob(["σ"]); 121cb0ef41Sopenharmony_ci const reader = new FileReader(); 131cb0ef41Sopenharmony_ci 141cb0ef41Sopenharmony_ci reader.onload = t.step_func_done(() => { 151cb0ef41Sopenharmony_ci assert_equals(typeof reader.result, "string", "The result is string"); 161cb0ef41Sopenharmony_ci assert_equals(reader.result.length, 2, "The result length is 2"); 171cb0ef41Sopenharmony_ci assert_equals(reader.result, "\xcf\x83", "The result is \xcf\x83"); 181cb0ef41Sopenharmony_ci assert_equals(reader.readyState, reader.DONE); 191cb0ef41Sopenharmony_ci }); 201cb0ef41Sopenharmony_ci 211cb0ef41Sopenharmony_ci reader.onloadstart = t.step_func(() => { 221cb0ef41Sopenharmony_ci assert_equals(reader.readyState, reader.LOADING); 231cb0ef41Sopenharmony_ci }); 241cb0ef41Sopenharmony_ci 251cb0ef41Sopenharmony_ci reader.onprogress = t.step_func(() => { 261cb0ef41Sopenharmony_ci assert_equals(reader.readyState, reader.LOADING); 271cb0ef41Sopenharmony_ci }); 281cb0ef41Sopenharmony_ci 291cb0ef41Sopenharmony_ci reader.readAsBinaryString(blob); 301cb0ef41Sopenharmony_ci}); 311cb0ef41Sopenharmony_ci 321cb0ef41Sopenharmony_ci</script> 33