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

Unified Diff: LayoutTests/fast/files/blob-parts-slice-test.html

Issue 57483002: Implement File constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed most feedback. Created 7 years, 1 month 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
Index: LayoutTests/fast/files/blob-parts-slice-test.html
diff --git a/LayoutTests/fast/files/blob-parts-slice-test.html b/LayoutTests/fast/files/blob-parts-slice-test.html
new file mode 100644
index 0000000000000000000000000000000000000000..9f2f47b0dfe07fbd938f4a19b07285629616e2b6
--- /dev/null
+++ b/LayoutTests/fast/files/blob-parts-slice-test.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test.js"></script>
+<script src="resources/blob-slice-common.js"></script>
+<script>
+description("Test the Blob.slice() behavior for Blobs made of multiple parts.");
+
+var sliceTestCases = [
+ [2, 3, "2"],
+ [2, 12, "23456789"],
+ [2, 2, ""],
+ [2, 1, ""],
+ [2, -12, ""],
+ [2, 2147483647, "23456789"],
+ [2, -2147483648, ""],
+ [2, 9223372036854775000, "23456789"],
+ [2, -9223372036854775000, ""],
+ [-2, -1, "8"],
+ [-2, -2, ""],
+ [-2, -3, ""],
+ [-2, -12, ""],
+ [-2, 2147483647, "89"],
+ [-2, -2147483648, ""],
+ [-2, 9223372036854775000, "89"],
+ [-2, -9223372036854775000, ""],
+ [0, null, "0123456789"],
+ [2, null, "23456789"],
+ [-2, null, "89"],
+ [12, null, ""],
+ [-12, null, "0123456789"],
+ [2147483647, null, ""],
+ [-2147483648, null, "0123456789"],
+ [9223372036854775000, null, ""],
+ [-9223372036854775000, null, "0123456789"],
+ [null, null, "0123456789"],
+];
+
+function runTests()
+{
+ blob = new Blob(["0", new File(["12"], "slice-piece.txt"),
+ new Blob(["345"]), "6789"]);
+ file = new File(["0", new File(["12"], "slice-piece.txt"),
+ new Blob(["345"]), "6789"], "slice-text.txt");
+
+ runNextTest();
+}
+
+window.jsTestIsAsync = true;
+</script>
+</head>
+<body onload="runTests()">
+<pre id='console'></pre>
+</body>
+</html>
« no previous file with comments | « LayoutTests/fast/files/blob-constructor-expected.txt ('k') | LayoutTests/fast/files/blob-parts-slice-test-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698