Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2519)

Unified Diff: conformance/programs/invalid-UTF-16.html

Issue 8342021: Add webgl conformance tests r15841. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/webgl/sdk/tests/
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « conformance/programs/gl-shader-test.html ('k') | conformance/programs/program-test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: conformance/programs/invalid-UTF-16.html
===================================================================
--- conformance/programs/invalid-UTF-16.html (revision 0)
+++ conformance/programs/invalid-UTF-16.html (revision 0)
@@ -0,0 +1,50 @@
+<!--
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+ -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css">
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/webgl-test.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+ if (window.initNonKhronosFramework) {
+ window.initNonKhronosFramework(false);
+ }
+</script>
+<script>
+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.');
+
+var array = [];
+array.push(String.fromCharCode(0x48)); // H
+array.push(String.fromCharCode(0x69)); // i
+array.push(String.fromCharCode(0xd87e)); // Bogus
+var string = array.join('');
+
+// In order to make this test not depend on WebGL, the following were
+// attempted:
+// - Send a string to console.log
+// - Submit a mailto: form containing a text input with the bogus
+// string
+// The first code path does not perform a utf8 conversion of the
+// incoming string unless Console::shouldPrintExceptions() returns
+// true. The second seems to sanitize the form's input before
+// converting it to a UTF8 string.
+
+var gl = create3DContext(null);
+var program = gl.createProgram();
+gl.bindAttribLocation(program, 0, string);
+testPassed("bindAttribLocation with invalid UTF-16 did not crash");
+
+successfullyParsed = true;
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
Property changes on: conformance/programs/invalid-UTF-16.html
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « conformance/programs/gl-shader-test.html ('k') | conformance/programs/program-test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698