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

Unified Diff: third_party/WebKit/LayoutTests/fast/files/blob-constructor.html

Issue 1362963003: Blob/File constructors/slice method shouldn't throw on invalid types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated win expectation Created 3 years, 9 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
Index: third_party/WebKit/LayoutTests/fast/files/blob-constructor.html
diff --git a/third_party/WebKit/LayoutTests/fast/files/blob-constructor.html b/third_party/WebKit/LayoutTests/fast/files/blob-constructor.html
index f8a266cb0756eee57e8732d3b80bbb5260b01495..5261d19ff472233378cc26b2fdd4c7469f3729df 100644
--- a/third_party/WebKit/LayoutTests/fast/files/blob-constructor.html
+++ b/third_party/WebKit/LayoutTests/fast/files/blob-constructor.html
@@ -50,7 +50,6 @@ shouldBeTrue("(new Blob([], {unknownKey:'value'})) instanceof window.Blob");
shouldThrow("new Blob([], {endings:'illegalValue'})", "'TypeError: Failed to construct \\'Blob\\': The provided value \\'illegalValue\\' is not a valid enum value of type NormalizeLineEndings.'");
shouldThrow("new Blob([], {endings:throwingObj})", "'Error'");
shouldThrow("new Blob([], {type:throwingObj})", "'Error'");
-shouldThrow("new Blob([], {type:'hello\u00EE'})", "'SyntaxError: Failed to construct \\'Blob\\': The \\'type\\' property must consist of ASCII characters.'");
// Test that order of property bag evaluation is lexigraphical
var throwingObj1 = { toString: function() { throw "Error 1"; } };
@@ -59,6 +58,19 @@ shouldThrow("new Blob([], {endings:throwingObj1, type:throwingObj2})", "'Error 1
shouldThrow("new Blob([], {type:throwingObj2, endings:throwingObj1})", "'Error 1'");
shouldThrow("new Blob([], {type:throwingObj2, endings:'illegal'})", "'TypeError: Failed to construct \\'Blob\\': The provided value \\'illegal\\' is not a valid enum value of type NormalizeLineEndings.'");
+// Test non-ASCII type handling
+shouldBeEqualToString("new Blob([], {type:'hello\\u00EE'}).type", "");
+
+// Test non-printable-ASCII type handling
+shouldBeEqualToString("new Blob([], {type:'hello\\u001F'}).type", "");
+shouldBeEqualToString("new Blob([], {type:'hello\\u007F'}).type", "");
+
+// Test lowercasing of type
+shouldBeEqualToString("new Blob([], {type:'ABC/abc'}).type", "abc/abc");
+
+// Test non-parsable type
+shouldBeEqualToString("new Blob([], {type:'123ABCabc'}).type", "123abcabc");
+
// Test various non-object literals being used as property bags.
shouldBeTrue("(new Blob([], null)) instanceof window.Blob");
shouldBeTrue("(new Blob([], undefined)) instanceof window.Blob");

Powered by Google App Engine
This is Rietveld 408576698