Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / storage / websql / null-characters.html
blob750a5eeca5c58c4168d664e3a116c76f694e74b2
1 <!DOCTYPE html>
2 <title>String handling of NULL (U+0000) characters</title>
3 <script src="../../resources/js-test.js"></script>
4 <script>
5 description("Test that embedded NULL (U+0000) characters don't truncate strings.");
6 window.jsTestIsAsync = true;
8 function errorCallback(transaction, error)
10 testFailed("Database error code: " + error.code + ", message: " + error.message);
13 var string = "foo\0bar";
14 var result;
16 function runTest()
18 if (window.testRunner)
19 testRunner.clearAllDatabases();
21 openDatabase("NullCharacterTest", "1.0", "Database for null characters test", 1,
22 function(db) {
23 db.readTransaction(function(t) {
24 t.executeSql("SELECT ? AS string", [string], function(t, data) {
25 result = data.rows[0].string;
26 shouldBeEqualToString("result", string);
27 finishJSTest();
28 }, errorCallback);
29 }, errorCallback);
30 });
33 runTest();
34 </script>