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

Unified Diff: LayoutTests/fast/dom/event-400476.html

Issue 516843004: Fix crash when accessing Event::path(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added regression test. Created 6 years, 4 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/event-400476-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/event-400476.html
diff --git a/LayoutTests/fast/dom/event-400476.html b/LayoutTests/fast/dom/event-400476.html
new file mode 100644
index 0000000000000000000000000000000000000000..1c19a7cc76577d6792506c9f6e4aef1aaa2cca58
--- /dev/null
+++ b/LayoutTests/fast/dom/event-400476.html
@@ -0,0 +1,34 @@
+<html>
haraken 2014/08/28 17:32:39 Make the test name more descriptive.
vogelheim 2014/08/29 15:20:52 Done.
+<head>
+<script>
haraken 2014/08/28 17:32:39 You can include resources/js-test.js, which has a
vogelheim 2014/08/29 15:20:52 Done.
+if (window.testRunner) {
+ testRunner.dumpAsText();
haraken 2014/08/28 17:32:39 Once you include js-test.js, testRunner.dumpAsText
vogelheim 2014/08/29 15:20:52 Done.
+ testRunner.waitUntilDone();
+}
+
+function test() {
+ root=document.documentElement;
haraken 2014/08/28 17:32:38 Use 4-indent space.
haraken 2014/08/28 17:32:39 Add 'var' to local variables.
vogelheim 2014/08/29 15:20:52 Done.
vogelheim 2014/08/29 15:20:52 Done. (Here & elsewhere.)
+ iframe=root.ownerDocument.createElementNS('http://www.w3.org/1999/xhtml','iframe');
haraken 2014/08/28 17:32:38 Add one space around '='.
vogelheim 2014/08/29 15:20:52 Done.
+ iframe.onload=iframe_onload_fn;
haraken 2014/08/28 17:32:39 iframe_onload_fn => iframeLoaded Use camelCase na
vogelheim 2014/08/29 15:20:52 Done.
+ root.appendChild(iframe);
+}
+function iframe_onload_fn() {
haraken 2014/08/28 17:32:39 Add one empty line between functions.
vogelheim 2014/08/29 15:20:52 Done.
+ defaultView=iframe.contentDocument.defaultView;
+ defaultView.onpageshow=onPageShow;
+ iframe.src=null;
+ window.setTimeout(triggerFn, 100);
haraken 2014/08/28 17:32:38 triggerFn => nextIframeLoaded Use a more descript
vogelheim 2014/08/29 15:20:52 Done.
+}
+function onPageShow() {
+ problem_ref=arguments[0];
+}
+function triggerFn() {
+ document.write('<p>' + problem_ref.path + '</p>');
haraken 2014/08/28 17:32:39 Don't use document.write unless it's really needed
vogelheim 2014/08/29 15:20:52 Done.
+ document.write('<p>PASS: totally did not crash.</p>');
+ testRunner.notifyDone();
+}
+</script>
haraken 2014/08/28 17:32:39 Put this <script> tag in <body>. Then you won't ne
vogelheim 2014/08/29 15:20:52 Done. (Well, it's still in the header, but the onl
+</head>
+<body onload="test();">
+<p>This is a regression test for crbug.com/400476. It should not crash and then brag about it.</p>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/event-400476-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698