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

Unified Diff: LayoutTests/fast/dom/HTMLLinkElement/link-preload-settings-no-crash.html

Issue 1107003002: Check the nullable Document::settings() before accessing. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | LayoutTests/fast/dom/HTMLLinkElement/link-preload-settings-no-crash-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/HTMLLinkElement/link-preload-settings-no-crash.html
diff --git a/LayoutTests/fast/dom/HTMLLinkElement/link-preload-settings-no-crash.html b/LayoutTests/fast/dom/HTMLLinkElement/link-preload-settings-no-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..e7593f8b8d3f54c118173839f749012787890017
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLLinkElement/link-preload-settings-no-crash.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../resources/js-test.js"></script>
+</head>
+<body>
+<link id="lnk" rel="preload" as="image" href="http://prefetch.wut.com.test/3.gif">
+<script>
+description("Inserting a <link rel=preload> into a bare document shouldn't crash.");
+
+window.jsTestIsAsync = true;
+
+function runTest() {
+ var doc = document.implementation.createDocument("", "", null);
+ doc.appendChild(document.getElementById("lnk"));
+ testPassed("no crash");
+ finishJSTest();
+}
+
+window.onload = runTest;
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/HTMLLinkElement/link-preload-settings-no-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698