From 19b21df7e40163f66a7597af7623306c5766220a Mon Sep 17 00:00:00 2001 From: Tom Tung Date: Tue, 3 Jan 2017 14:28:37 +0000 Subject: [PATCH 01/10] Add WPT tests for blocking 206 response. r=bkelly. Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1264181 --- .../cache-storage/script-tests/cache-add.js | 21 +++++++++++++++++++ .../cache-storage/script-tests/cache-put.js | 13 ++++++++++++ 2 files changed, 34 insertions(+) diff --git a/service-workers/cache-storage/script-tests/cache-add.js b/service-workers/cache-storage/script-tests/cache-add.js index c41c7bcef771d6..237ba473504c35 100644 --- a/service-workers/cache-storage/script-tests/cache-add.js +++ b/service-workers/cache-storage/script-tests/cache-add.js @@ -83,6 +83,26 @@ cache_test(function(cache) { }); }, 'Cache.add with request with null body (not consumed)'); +cache_test(function(cache, test) { + return assert_promise_rejects( + test, + new TypeError(), + cache.add('../resources/fetch-status.py?status=206'), + 'Cache.add should reject on partial response'); + }, 'Cache.add with 206 response'); + +cache_test(function(cache, test) { + var urls = ['../resources/fetch-status.py?status=206', + '../resources/fetch-status.py?status=200']; + var requests = urls.map(function(url) { + return new Request(url); + }); + return promise_rejects( + new TypeError(), + cache.addAll(requests), + 'Cache.addAll should reject with TypeError if any request fails'); + }, 'Cache.addAll with 206 response'); + cache_test(function(cache, test) { return promise_rejects( test, @@ -91,6 +111,7 @@ cache_test(function(cache, test) { 'Cache.add should reject if response is !ok'); }, 'Cache.add with request that results in a status of 404'); + cache_test(function(cache, test) { return promise_rejects( test, diff --git a/service-workers/cache-storage/script-tests/cache-put.js b/service-workers/cache-storage/script-tests/cache-put.js index 71a0e4d9c89f23..d71f725ae2ab77 100644 --- a/service-workers/cache-storage/script-tests/cache-put.js +++ b/service-workers/cache-storage/script-tests/cache-put.js @@ -102,6 +102,19 @@ cache_test(function(cache) { }); }, 'Cache.put with an empty response body'); +cache_test(function(cache) { + var request = new Request(test_url); + var response = new Response('', { + status: 206, + headers: [['Content-Type', 'text/plain']] + }); + + return assert_promise_rejects( + cache.put(request, response), + new TypeError(), + 'Cache.put should reject 206 Responses with a TypeError.'); + }, 'Cache.put with 206 response'); + cache_test(function(cache) { var test_url = new URL('../resources/fetch-status.py?status=500', location.href).href; var request = new Request(test_url); From 48fdfb4832c5acfc3893f3ab334a87ee38ecb510 Mon Sep 17 00:00:00 2001 From: Stone Shih Date: Tue, 3 Jan 2017 14:28:38 +0000 Subject: [PATCH 02/10] Pointer Event] Fix errors in pointer event test cases. MozReview-Commit-ID: KEayE2B7aKX Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1323916 --- ...eleasepointercapture_release_right_after_capture-manual.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pointerevents/pointerevent_releasepointercapture_release_right_after_capture-manual.html b/pointerevents/pointerevent_releasepointercapture_release_right_after_capture-manual.html index 5a166a57a53ced..8f64b9208732da 100644 --- a/pointerevents/pointerevent_releasepointercapture_release_right_after_capture-manual.html +++ b/pointerevents/pointerevent_releasepointercapture_release_right_after_capture-manual.html @@ -20,7 +20,7 @@ detected_pointertypes[event.pointerType] = true; target0.setPointerCapture(event.pointerId); target0.releasePointerCapture(event.pointerId); - assert_equals(target0.hasPointerCapture(e.pointerId), false, "After target0.releasePointerCapture, target0.hasPointerCapture should be false"); + assert_equals(target0.hasPointerCapture(event.pointerId), false, "After target0.releasePointerCapture, target0.hasPointerCapture should be false"); }); on_event(target0, "gotpointercapture", function (event) { From aeee2e93ec5f175719ac08285853795543245a68 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Tue, 3 Jan 2017 14:28:39 +0000 Subject: [PATCH 03/10] Test. MozReview-Commit-ID: 60HmJf3G2CR Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1286150 --- .../spacing-keyframes-shapes.html | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 web-animations/animation-model/animation-types/spacing-keyframes-shapes.html diff --git a/web-animations/animation-model/animation-types/spacing-keyframes-shapes.html b/web-animations/animation-model/animation-types/spacing-keyframes-shapes.html new file mode 100644 index 00000000000000..9f7cfaea1e42df --- /dev/null +++ b/web-animations/animation-model/animation-types/spacing-keyframes-shapes.html @@ -0,0 +1,152 @@ + + +Keyframe spacing tests on shapes + + + + + +
+ + From 506113d7ebac8b4b00910ee828ffc52b75ea943b Mon Sep 17 00:00:00 2001 From: Kevin Wern Date: Tue, 3 Jan 2017 14:28:41 +0000 Subject: [PATCH 04/10] support focusin/focusout based on webkit/blink Blink and webkit launch focusin after focus and focusout after blur. Despite this contradiction with the spec, it is best to mirror this new way, as there is little guidance or existing code to clarify implementation amiguities that can arise from the spec. If focus/blur is fired on a window or document, or the event triggers a change of focus, do not fire the corresponding focusin/focusout. Otherwise, always fire the corresponding event. Additionally, add a mochitest and a w3c-platform-test. MozReview-Commit-ID: AgQ8JBxKIqK Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=687787 --- .../focus-automated-blink-webkit.html | 170 ++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 uievents/order-of-events/focus-events/focus-automated-blink-webkit.html diff --git a/uievents/order-of-events/focus-events/focus-automated-blink-webkit.html b/uievents/order-of-events/focus-events/focus-automated-blink-webkit.html new file mode 100644 index 00000000000000..f98109a9f15c65 --- /dev/null +++ b/uievents/order-of-events/focus-events/focus-automated-blink-webkit.html @@ -0,0 +1,170 @@ + + + + + + + Focus-related events should fire in the correct order + + + + + + + + +
+ + +
+ + + From 411dcd53f001fd5f11e96d2779e1508f2600556f Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Tue, 3 Jan 2017 14:28:43 +0000 Subject: [PATCH 05/10] css-align] Change "last-baseline" to "last baseline" in testing/ (scripted change). Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1313254 --- .../animation-model/animation-types/type-per-property.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web-animations/animation-model/animation-types/type-per-property.html b/web-animations/animation-model/animation-types/type-per-property.html index 683b0093ac4929..1bfbfc8d95c6a6 100644 --- a/web-animations/animation-model/animation-types/type-per-property.html +++ b/web-animations/animation-model/animation-types/type-per-property.html @@ -110,19 +110,19 @@ "justify-content": { // https://drafts.csswg.org/css-align/#propdef-justify-content tests: [ - discrete("baseline", "last-baseline") + discrete("baseline", "last baseline") ] }, "justify-items": { // https://drafts.csswg.org/css-align/#propdef-justify-items tests: [ - discrete("baseline", "last-baseline") + discrete("baseline", "last baseline") ] }, "justify-self": { // https://drafts.csswg.org/css-align/#propdef-justify-self tests: [ - discrete("baseline", "last-baseline") + discrete("baseline", "last baseline") ] }, "mask-type": { From dd8603617f479b802eafcc0e0add7ee29d32db58 Mon Sep 17 00:00:00 2001 From: Bevis Tseng Date: Tue, 3 Jan 2017 14:28:44 +0000 Subject: [PATCH 06/10] Fix the race condition to prevent the access of metadata in both PBackground thread and the Connection thread. Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1309527 --- IndexedDB/idbindex-rename.html | 1 + IndexedDB/idbobjectstore-rename-store.html | 1 + 2 files changed, 2 insertions(+) diff --git a/IndexedDB/idbindex-rename.html b/IndexedDB/idbindex-rename.html index 2ef26d295e959c..370b83e5351d38 100644 --- a/IndexedDB/idbindex-rename.html +++ b/IndexedDB/idbindex-rename.html @@ -1,4 +1,5 @@ + IndexedDB: index renaming support diff --git a/IndexedDB/idbobjectstore-rename-store.html b/IndexedDB/idbobjectstore-rename-store.html index 47860b59014224..d07a46487ba3aa 100644 --- a/IndexedDB/idbobjectstore-rename-store.html +++ b/IndexedDB/idbobjectstore-rename-store.html @@ -1,4 +1,5 @@ + IndexedDB: object store renaming support From 76083538b32b38a4d2b05bf4e29e22858dbebaf7 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Tue, 3 Jan 2017 14:28:44 +0000 Subject: [PATCH 07/10] Do not expect init segment to be parsed when appending corrupted data. From the Segment Parser Loop definition: https://w3c.github.io/media-source/index.html#sourcebuffer-segment-parser-loop "2. If the input buffer contains bytes that violate the SourceBuffer byte stream format specification, then run the append error algorithm and abort this algorithm." The test appends data with a valid init segment followed by corrupted content. The corrupted content satisfies the condition that the input buffer contains bytes that violate byte stream format specification. As such, the append error algorithm is to be run prior parsing the init segment. Add a new test verifying the defined behavior. Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1314533 --- media-source/mediasource-errors.html | 43 ++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/media-source/mediasource-errors.html b/media-source/mediasource-errors.html index c019ebc660026a..3df1dedcc2ba08 100644 --- a/media-source/mediasource-errors.html +++ b/media-source/mediasource-errors.html @@ -174,13 +174,49 @@ { assert_equals(mediaElement.readyState, HTMLMediaElement.HAVE_NOTHING); + var initSegment = MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.init); + test.expectEvent(sourceBuffer, "updateend", "mediaSegment append ended."); + test.expectEvent(mediaElement, "loadedmetadata", "mediaElement metadata."); + sourceBuffer.appendBuffer(initSegment); + + test.waitForExpectedEvents(function() + { + assert_equals(mediaElement.readyState, HTMLMediaElement.HAVE_METADATA); + var mediaSegment = MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.media[0]); + var index = segmentInfo.init.size + (mediaSegment.length - 1) / 2; + // Corrupt the media data from index of mediaData, so it can signal 'decode' error. + // Here use mediaSegment to replace the original mediaData[index, index + mediaSegment.length] + mediaData.set(mediaSegment, index); + + test.expectEvent(sourceBuffer, "error", "sourceBuffer error."); + test.expectEvent(sourceBuffer, "updateend", "mediaSegment append ended."); + test.expectEvent(mediaElement, "error", "mediaElement error."); + test.expectEvent(mediaSource, "sourceended", "mediaSource ended."); + sourceBuffer.appendBuffer(mediaData); + }); + + test.waitForExpectedEvents(function() + { + assert_true(mediaElement.error != null); + assert_equals(mediaElement.error.code, MediaError.MEDIA_ERR_DECODE); + test.done(); + }); + }, "Signaling 'decode' error via segment parser loop algorithm after initialization segment has been appended."); + + ErrorTest(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData) + { + assert_equals(mediaElement.readyState, HTMLMediaElement.HAVE_NOTHING); + + // Fail if the append error algorithm occurs, since the network + // error will be provided by us directly via endOfStream(). + mediaElement.addEventListener("loadedmetadata", test.unreached_func("'loadedmetadata' should not be fired on mediaElement")); + var mediaSegment = MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.media[0]); var index = segmentInfo.init.size + (mediaSegment.length - 1) / 2; // Corrupt the media data from index of mediaData, so it can signal 'decode' error. // Here use mediaSegment to replace the original mediaData[index, index + mediaSegment.length] mediaData.set(mediaSegment, index); - test.expectEvent(mediaElement, "loadedmetadata", "mediaElement metadata."); test.expectEvent(sourceBuffer, "error", "sourceBuffer error."); test.expectEvent(sourceBuffer, "updateend", "mediaSegment append ended."); test.expectEvent(mediaElement, "error", "mediaElement error."); @@ -189,9 +225,10 @@ test.waitForExpectedEvents(function() { + assert_equals(mediaElement.readyState, HTMLMediaElement.HAVE_NOTHING); assert_true(mediaElement.error != null); - assert_equals(mediaElement.error.code, MediaError.MEDIA_ERR_DECODE); + assert_equals(mediaElement.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED); test.done(); }); - }, "Signaling 'decode' error via segment parser loop algorithm after initialization segment and partial media segment has been appended."); + }, "Signaling 'decode' error via segment parser loop algorithm."); From f7b29cb401f2ad26ddb641a14eb98f39d8449811 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Tue, 3 Jan 2017 14:28:45 +0000 Subject: [PATCH 08/10] Test. MozReview-Commit-ID: 1hFdxbHAwmB Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1273784 --- .../KeyframeEffect/copy-contructor.html | 27 ++++++ .../copy-contructor.html | 94 +++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 web-animations/interfaces/KeyframeEffect/copy-contructor.html create mode 100644 web-animations/interfaces/KeyframeEffectReadOnly/copy-contructor.html diff --git a/web-animations/interfaces/KeyframeEffect/copy-contructor.html b/web-animations/interfaces/KeyframeEffect/copy-contructor.html new file mode 100644 index 00000000000000..bc278389c108f0 --- /dev/null +++ b/web-animations/interfaces/KeyframeEffect/copy-contructor.html @@ -0,0 +1,27 @@ + + +KeyframeEffect copy constructor tests + + + + + +
+ + diff --git a/web-animations/interfaces/KeyframeEffectReadOnly/copy-contructor.html b/web-animations/interfaces/KeyframeEffectReadOnly/copy-contructor.html new file mode 100644 index 00000000000000..287ffe1148bdd8 --- /dev/null +++ b/web-animations/interfaces/KeyframeEffectReadOnly/copy-contructor.html @@ -0,0 +1,94 @@ + + +KeyframeEffectReadOnly copy constructor tests + + + + + +
+ + From 7a2c2be76f73911c1e64a6a1762e5c0de9183fad Mon Sep 17 00:00:00 2001 From: Tom Tung Date: Tue, 3 Jan 2017 14:28:46 +0000 Subject: [PATCH 09/10] Expose URL fragment to request but not response. Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1264178 --- service-workers/service-worker/fetch-event.https.html | 5 ++--- .../service-worker/resources/fetch-event-test-worker.js | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/service-workers/service-worker/fetch-event.https.html b/service-workers/service-worker/fetch-event.https.html index a9b0d6ca286e2e..dfa96ebb5c98b1 100644 --- a/service-workers/service-worker/fetch-event.https.html +++ b/service-workers/service-worker/fetch-event.https.html @@ -419,14 +419,13 @@ .then(function(frame) { assert_equals( frame.contentDocument.body.textContent, - 'Fragment Not Found', - 'Service worker should not expose URL fragments.'); + 'Fragment Found :' + fragment, + 'Service worker should expose URL fragments in request.'); frame.remove(); return service_worker_unregister_and_done(t, scope); }) .catch(unreached_rejection(t)); }, 'Service Worker must not expose FetchEvent URL fragments.'); - async_test(function(t) { var scope = 'resources/simple.html?cache'; var frame; diff --git a/service-workers/service-worker/resources/fetch-event-test-worker.js b/service-workers/service-worker/resources/fetch-event-test-worker.js index 32a1b4f24970ac..55ba4ab4d1163f 100644 --- a/service-workers/service-worker/resources/fetch-event-test-worker.js +++ b/service-workers/service-worker/resources/fetch-event-test-worker.js @@ -80,21 +80,19 @@ function handleUsedCheck(event) { 'bodyUsed: ' + lastResponseForUsedCheck.bodyUsed)); } } - function handleFragmentCheck(event) { var body; if (event.request.url.indexOf('#') === -1) { body = 'Fragment Not Found'; } else { - body = 'Fragment Found'; + body = 'Fragment Found :' + + event.request.url.substring(event.request.url.indexOf('#')); } event.respondWith(new Response(body)); } - function handleCache(event) { event.respondWith(new Response(event.request.cache)); } - function handleEventSource(event) { if (event.request.mode === 'navigate') { return; From f4c430de9d55f414668c754db5c2e655fbfe889f Mon Sep 17 00:00:00 2001 From: amy Date: Tue, 3 Jan 2017 14:28:47 +0000 Subject: [PATCH 10/10] Modify errors from try server, Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=976073 --- cookies/secure/set-from-dom.sub.html | 47 --------------------------- cookies/secure/set-from-http.sub.html | 36 -------------------- 2 files changed, 83 deletions(-) delete mode 100644 cookies/secure/set-from-dom.sub.html delete mode 100644 cookies/secure/set-from-http.sub.html diff --git a/cookies/secure/set-from-dom.sub.html b/cookies/secure/set-from-dom.sub.html deleted file mode 100644 index 91aa8fff3b706c..00000000000000 --- a/cookies/secure/set-from-dom.sub.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Set 'secure' cookie from `document.cookie` on a non-secure page - - - - - - -
- - - - diff --git a/cookies/secure/set-from-http.sub.html b/cookies/secure/set-from-http.sub.html deleted file mode 100644 index c80cc341017b5b..00000000000000 --- a/cookies/secure/set-from-http.sub.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - Set 'secure' cookie from `Set-Cookie` HTTP header on a non-secure page - - - - - - -
- - - -