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

Side by Side Diff: LayoutTests/fast/files/blob-constructor.html

Issue 1305393006: Don't NFC-normalize strings during Blob/File construction (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/files/blob-constructor-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 2
3 <script src="../../resources/js-test.js"></script> 3 <script src="../../resources/js-test.js"></script>
4 <script> 4 <script>
5 description("Test the Blob constructor."); 5 description("Test the Blob constructor.");
6 var jsTestIsAsync = true;
6 7
7 // Test the different ways you can construct a Blob. 8 // Test the different ways you can construct a Blob.
8 shouldBeTrue("(new Blob()) instanceof window.Blob"); 9 shouldBeTrue("(new Blob()) instanceof window.Blob");
9 shouldBeTrue("(new Blob([])) instanceof window.Blob"); 10 shouldBeTrue("(new Blob([])) instanceof window.Blob");
10 shouldBeTrue("(new Blob(['hello'])) instanceof window.Blob"); 11 shouldBeTrue("(new Blob(['hello'])) instanceof window.Blob");
11 shouldBeTrue("(new Blob(['hello'], {})) instanceof window.Blob"); 12 shouldBeTrue("(new Blob(['hello'], {})) instanceof window.Blob");
12 shouldBeTrue("(new Blob(['hello'], {type:'text/html'})) instanceof window.Blob") ; 13 shouldBeTrue("(new Blob(['hello'], {type:'text/html'})) instanceof window.Blob") ;
13 shouldBeTrue("(new Blob(['hello'], {type:'text/html', endings:'native'})) instan ceof window.Blob"); 14 shouldBeTrue("(new Blob(['hello'], {type:'text/html', endings:'native'})) instan ceof window.Blob");
14 shouldBeTrue("(new Blob(['hello'], {type:'text/html', endings:'transparent'})) i nstanceof window.Blob"); 15 shouldBeTrue("(new Blob(['hello'], {type:'text/html', endings:'transparent'})) i nstanceof window.Blob");
15 16
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 shouldBe("new Blob([(new Int32Array(100)).buffer]).size", "400"); 101 shouldBe("new Blob([(new Int32Array(100)).buffer]).size", "400");
101 shouldBe("new Blob([(new Float32Array(100)).buffer]).size", "400"); 102 shouldBe("new Blob([(new Float32Array(100)).buffer]).size", "400");
102 shouldBe("new Blob([(new Float64Array(100)).buffer]).size", "800"); 103 shouldBe("new Blob([(new Float64Array(100)).buffer]).size", "800");
103 shouldBe("new Blob([(new Float64Array(100)).buffer, (new Int32Array(100)).buffer , (new Uint8Array(100)).buffer, (new DataView(new ArrayBuffer(100))).buffer]).si ze", "1400"); 104 shouldBe("new Blob([(new Float64Array(100)).buffer, (new Int32Array(100)).buffer , (new Uint8Array(100)).buffer, (new DataView(new ArrayBuffer(100))).buffer]).si ze", "1400");
104 shouldBe("new Blob([new Blob([(new Int32Array(100)).buffer]), (new Uint8Array(10 0)).buffer, (new Float32Array(100)).buffer, (new DataView(new ArrayBuffer(100))) .buffer]).size", "1000"); 105 shouldBe("new Blob([new Blob([(new Int32Array(100)).buffer]), (new Uint8Array(10 0)).buffer, (new Float32Array(100)).buffer, (new DataView(new ArrayBuffer(100))) .buffer]).size", "1000");
105 106
106 // Test passing blob parts in objects with indexed properties. 107 // Test passing blob parts in objects with indexed properties.
107 // (This depends on the bindings code handling of sequence<T>) 108 // (This depends on the bindings code handling of sequence<T>)
108 shouldBe("new Blob({length: 0}).size", "0"); 109 shouldBe("new Blob({length: 0}).size", "0");
109 shouldBe("new Blob({length: 1, 0: 'string'}).size", "6"); 110 shouldBe("new Blob({length: 1, 0: 'string'}).size", "6");
111
112 // Test that strings are not NFC normalized
113 var OMICRON_WITH_OXIA = '\u1F79'; // NFC normalized to U+3CC
114 shouldBe("OMICRON_WITH_OXIA.charCodeAt(0)", "0x1F79");
115 var reader = new FileReader();
116 reader.readAsText(new Blob([OMICRON_WITH_OXIA]));
117 reader.onload = function() {
118 shouldBe("reader.result.charCodeAt(0)", "0x1F79");
119 finishJSTest();
120 };
110 </script> 121 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/files/blob-constructor-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698