From dbd4f0bed5e49c4571c39d5c91375bcfdc338d6e Mon Sep 17 00:00:00 2001 From: Masatoshi Kimura Date: Tue, 3 Apr 2012 20:08:28 -0400 Subject: [PATCH] Bug 738912 - Part 2: Add tests. r=sicking --- content/base/test/test_blobconstructor.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/content/base/test/test_blobconstructor.html b/content/base/test/test_blobconstructor.html index c5475d86d9c..8ebcdf08be0 100644 --- a/content/base/test/test_blobconstructor.html +++ b/content/base/test/test_blobconstructor.html @@ -63,6 +63,22 @@ ok(false, "NOT REACHED"); ok(true, "an undefined options member should throw"); } +/** Test for dictionary initialization order **/ +(function() { + var o = {}; + var p = {type: "text/plain", endings: "transparent"}; + var called = []; + function add_to_called(n) { + called.push(n); + return p[n]; + } + ["type", "endings"].forEach(function(n) { + Object.defineProperty(o, n, { get: add_to_called.bind(null, n) }); + }); + var b = new Blob([], o); + is(JSON.stringify(called), JSON.stringify(["endings", "type"]), "dictionary members should be get in lexicographical order"); +})(); + let blob1 = Blob(["squiggle"]); ok(blob1 instanceof Blob, "Blob constructor should produce Blobs"); ok(!(blob1 instanceof File), "Blob constructor should not produce Files");