3 <script src=
"../../../resources/js-test.js"></script>
4 <script src=
"resources/webgl-test.js"></script>
8 if (window
.initNonKhronosFramework
) {
9 window
.initNonKhronosFramework(false);
13 description('This test verifies that the internal conversion from UTF16 to UTF8 is robust to invalid inputs. Any DOM entry point which converts an incoming string to UTF8 could be used for this test.');
16 array
.push(String
.fromCharCode(0x48)); // H
17 array
.push(String
.fromCharCode(0x69)); // i
18 array
.push(String
.fromCharCode(0xd87e)); // Bogus
19 var string
= array
.join('');
21 // In order to make this test not depend on WebGL, the following were
23 // - Send a string to console.log
24 // - Submit a mailto: form containing a text input with the bogus
26 // The first code path does not perform a utf8 conversion of the
27 // incoming string unless Console::shouldPrintExceptions() returns
28 // true. The second seems to sanitize the form's input before
29 // converting it to a UTF8 string.
31 var gl
= create3DContext(null);
32 var program
= gl
.createProgram();
33 gl
.bindAttribLocation(program
, 0, string
);
34 testPassed("bindAttribLocation with invalid UTF-16 did not crash");