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

Unified Diff: LayoutTests/http/tests/dom/crash-on-querying-event-path.html

Issue 516843004: Fix crash when accessing Event::path(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More work on the test case. 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/http/tests/dom/crash-on-querying-event-path-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/dom/crash-on-querying-event-path.html
diff --git a/LayoutTests/http/tests/dom/crash-on-querying-event-path.html b/LayoutTests/http/tests/dom/crash-on-querying-event-path.html
new file mode 100644
index 0000000000000000000000000000000000000000..90ff0919859f9354649c00a43e7a4b623d46ca11
--- /dev/null
+++ b/LayoutTests/http/tests/dom/crash-on-querying-event-path.html
@@ -0,0 +1,45 @@
+<html>
+<head>
+<script src="/js-test-resources/js-test.js"></script>
+<script>
+ var jsTestIsAsync = true;
haraken 2014/08/31 06:54:15 Nit: We normally don't indent the top-level block
vogelheim 2014/09/01 14:31:12 Done.
+ description('This is a regression test for crbug.com/400476. It should not crash and then brag about it.')
+
+ var root = document.documentElement;
+ var iframe = root.ownerDocument.createElement('iframe');
+ iframe.onload = iframeOnload;
+ root.appendChild(iframe);
+
+ function iframeOnload() {
+ var defaultView = iframe.contentDocument.defaultView;
+ defaultView.onpageshow = onPageShow;
+ iframe.src = null;
+ window.setTimeout(nextIframeLoaded, 100);
+ }
+
+ function onPageShow() {
+ eventObj = arguments[0];
+ }
+
+ function nextIframeLoaded() {
+ // Access of eventObj.path caused the crash.
+ // The test is somewhat flaky, in that the test may pass as correct
+ // despite the bug being the code. The exact conditions
+ // are unclear, but 1, asan helps detect the crash and 2, the
+ // preceeding gc()s increase the likelihood of it occurring.
+ gc();
+ gc();
+ gc();
+ gc();
+ gc();
+ var path = eventObj.path;
+ debug(path);
+
+ testPassed('totally did not crash.');
+ finishJSTest();
+ }
+</script>
haraken 2014/08/31 06:54:15 Nit: You can put the script into the <body>.
vogelheim 2014/09/01 14:31:12 Done.
+</head>
+<body>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/http/tests/dom/crash-on-querying-event-path-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698