Chromium Code Reviews

Side by Side 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, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="/js-test-resources/js-test.js"></script>
4 <script>
5 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.
6 description('This is a regression test for crbug.com/400476. It should not c rash and then brag about it.')
7
8 var root = document.documentElement;
9 var iframe = root.ownerDocument.createElement('iframe');
10 iframe.onload = iframeOnload;
11 root.appendChild(iframe);
12
13 function iframeOnload() {
14 var defaultView = iframe.contentDocument.defaultView;
15 defaultView.onpageshow = onPageShow;
16 iframe.src = null;
17 window.setTimeout(nextIframeLoaded, 100);
18 }
19
20 function onPageShow() {
21 eventObj = arguments[0];
22 }
23
24 function nextIframeLoaded() {
25 // Access of eventObj.path caused the crash.
26 // The test is somewhat flaky, in that the test may pass as correct
27 // despite the bug being the code. The exact conditions
28 // are unclear, but 1, asan helps detect the crash and 2, the
29 // preceeding gc()s increase the likelihood of it occurring.
30 gc();
31 gc();
32 gc();
33 gc();
34 gc();
35 var path = eventObj.path;
36 debug(path);
37
38 testPassed('totally did not crash.');
39 finishJSTest();
40 }
41 </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.
42 </head>
43 <body>
44 </body>
45 </html>
OLDNEW
« 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