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

Unified Diff: third_party/WebKit/LayoutTests/crypto/subtle/importKey-badParameters.html

Issue 2707243006: [SharedArrayBuffer] Prevent SharedArrayBuffer being used in Web APIs (Closed)
Patch Set: update comment, add TODO Created 3 years, 8 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/crypto/subtle/importKey-badParameters.html
diff --git a/third_party/WebKit/LayoutTests/crypto/subtle/importKey-badParameters.html b/third_party/WebKit/LayoutTests/crypto/subtle/importKey-badParameters.html
index 9052c100a9a744e5b9b912a1824d835dc3222391..303f4e233aaa46790fdc00d6fcb9dbbd269faf0b 100644
--- a/third_party/WebKit/LayoutTests/crypto/subtle/importKey-badParameters.html
+++ b/third_party/WebKit/LayoutTests/crypto/subtle/importKey-badParameters.html
@@ -62,6 +62,16 @@ Promise.resolve(null).then(function() {
return crypto.subtle.importKey('raw', new Uint8Array(20), {name: 'sha-1'}, extractable, ['sign']);
}).then(failAndFinishJSTest, function(result) {
logError(result);
+
+ // SharedArrayBuffer-backed view is not allowed.
+ if (window.SharedArrayBuffer) {
+ var bytes = new Uint8Array(new SharedArrayBuffer(16));
+ return crypto.subtle.importKey('raw', bytes, aesCbc, extractable, ['encrypt']);
+ } else {
+ return Promise.reject('SharedArrayBuffers not enabled.');
+ }
+}).then(failAndFinishJSTest, function(result) {
+ logError(result);
}).then(finishJSTest, failAndFinishJSTest);
</script>

Powered by Google App Engine
This is Rietveld 408576698