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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-service-worker-link-rel.php

Issue 2358993003: Service worker creation from <link> leads to nullptr dereference (Closed)
Patch Set: Formatting Created 4 years, 3 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/http/tests/security/suborigins/suborigin-service-worker-link-rel.php
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-service-worker-link-rel.php b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-service-worker-link-rel.php
new file mode 100644
index 0000000000000000000000000000000000000000..51c09bd9fab208f7724b71faea725e3875fbfe12
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-service-worker-link-rel.php
@@ -0,0 +1,23 @@
+<?php
+header("Suborigin: foobar");
+?>
+<!DOCTYPE html>
+<html>
+<head>
+<title>Service Worker link rel fails from a suborigin</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<script>
+var link = document.createElement('link');
+link.setAttribute('rel', 'serviceworker');
+link.setAttribute('href', '/serviceworker/resources/empty-worker.js');
+link.onload = function() {
+ assert_unreached('Service worker was successfully registered with a <link> element');
+}
+link.onerror = function() {
+ done();
+}
+document.getElementsByTagName('head')[0].appendChild(link);
+</script>
+</html>

Powered by Google App Engine
This is Rietveld 408576698