Skip to content

Commit

Permalink
Add test to ensure FileReaderSync isn't supported in service workers. (
Browse files Browse the repository at this point in the history
…#4766)

This was removed from the spec in w3c/FileAPI#16.
  • Loading branch information
mkruisselbrink authored and Ms2ger committed Mar 16, 2017
1 parent 15b8e94 commit 5db343c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions FileAPI/historical.html → FileAPI/historical.https.html
Expand Up @@ -5,6 +5,7 @@
<title>Historical features</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
</head>
<body>
<div id="log"></div>
Expand Down Expand Up @@ -48,6 +49,10 @@
assert_false('isClosed' in b, 'isClosed in b');
assert_false('isClosed' in Blob.prototype, 'isClosed in Blob.prototype');
}, 'Blob.close() should not be supported');

// Only add service worker test if service workers are actually supported.
if (navigator.serviceWorker)
service_worker_test('support/historical-serviceworker.js', 'Service worker test setup');
</script>
</body>
</html>
5 changes: 5 additions & 0 deletions FileAPI/support/historical-serviceworker.js
@@ -0,0 +1,5 @@
importScripts('/resources/testharness.js');

test(() => {
assert_false('FileReaderSync' in self);
}, '"FileReaderSync" should not be supported in service workers');

0 comments on commit 5db343c

Please sign in to comment.