content/canvas/test/webgl-conformance/conformance/programs/invalid-UTF-16.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

michael@0 1 <!--
michael@0 2 Copyright (c) 2011 The Chromium Authors. All rights reserved.
michael@0 3 Use of this source code is governed by a BSD-style license that can be
michael@0 4 found in the LICENSE file.
michael@0 5 -->
michael@0 6 <!DOCTYPE html>
michael@0 7 <html>
michael@0 8 <head>
michael@0 9 <meta charset="utf-8">
michael@0 10 <link rel="stylesheet" href="../../resources/js-test-style.css">
michael@0 11 <script src="../../resources/js-test-pre.js"></script>
michael@0 12 <script src="../resources/webgl-test.js"></script>
michael@0 13 </head>
michael@0 14 <body>
michael@0 15 <p id="description"></p>
michael@0 16 <div id="console"></div>
michael@0 17 <script>
michael@0 18 if (window.initNonKhronosFramework) {
michael@0 19 window.initNonKhronosFramework(false);
michael@0 20 }
michael@0 21 </script>
michael@0 22 <script>
michael@0 23 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.');
michael@0 24
michael@0 25 var array = [];
michael@0 26 array.push(String.fromCharCode(0x48)); // H
michael@0 27 array.push(String.fromCharCode(0x69)); // i
michael@0 28 array.push(String.fromCharCode(0xd87e)); // Bogus
michael@0 29 var string = array.join('');
michael@0 30
michael@0 31 // In order to make this test not depend on WebGL, the following were
michael@0 32 // attempted:
michael@0 33 // - Send a string to console.log
michael@0 34 // - Submit a mailto: form containing a text input with the bogus
michael@0 35 // string
michael@0 36 // The first code path does not perform a utf8 conversion of the
michael@0 37 // incoming string unless Console::shouldPrintExceptions() returns
michael@0 38 // true. The second seems to sanitize the form's input before
michael@0 39 // converting it to a UTF8 string.
michael@0 40
michael@0 41 var gl = create3DContext();
michael@0 42 var program = gl.createProgram();
michael@0 43 gl.bindAttribLocation(program, 0, string);
michael@0 44 testPassed("bindAttribLocation with invalid UTF-16 did not crash");
michael@0 45
michael@0 46 successfullyParsed = true;
michael@0 47 </script>
michael@0 48 <script>finishTest();</script>
michael@0 49 </body>
michael@0 50 </html>

mercurial