tizen beta release
[profile/ivi/webkit-efl.git] / LayoutTests / fast / canvas / webgl / invalid-UTF-16.html
1 <html>
2 <head>
3 <script src="../../js/resources/js-test-pre.js"></script>
4 <script src="resources/webgl-test.js"></script>
5 </head>
6 <body>
7 <script>
8     if (window.initNonKhronosFramework) {
9         window.initNonKhronosFramework(false);
10     }
11 </script>
12 <script>
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.');
14
15 var array = [];
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('');
20
21 // In order to make this test not depend on WebGL, the following were
22 // attempted:
23 //  - Send a string to console.log
24 //  - Submit a mailto: form containing a text input with the bogus
25 //    string
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.
30
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");
35 </script>
36 <script src="../../js/resources/js-test-post.js"></script>
37 </body>
38 </html>