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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/dom/crash-on-querying-event-path.html

Issue 1374533002: Null out LocalDOMWindow::m_frame on navigation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: try to fix crash-on-querying-event-path.html Created 5 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="/js-test-resources/js-test.js"></script>
4 </head>
5 <body>
6 <script>
7 var jsTestIsAsync = true;
8 description('This is a regression test for crbug.com/400476. It should not crash and then brag about it.')
9
10 var root = document.documentElement;
11 var iframe = root.ownerDocument.createElement('iframe');
12 var timeouts = [];
13 iframe.onload = iframeOnload;
14 root.appendChild(iframe);
15
16 function iframeOnload() {
17 var defaultView = iframe.contentDocument.defaultView;
18 defaultView.onpageshow = onPageShow;
19 iframe.src = null;
20 timeouts[timeouts.length] = window.setTimeout(nextIframeLoaded, 100);
21 }
22
23 function onPageShow() {
24 eventObj = arguments[0];
25 }
26
27 function nextIframeLoaded() {
28 timeouts.forEach(window.clearTimeout);
29
30 // Access of eventObj.path caused the crash.
31 // The test is somewhat flaky, in that the test may pass as correct
32 // despite the bug being the code. The exact conditions
33 // are unclear, but 1, asan helps detect the crash and 2, the
34 // preceeding gc()s increase the likelihood of it occurring.
35 gc();
36 gc();
37 gc();
38 gc();
39 gc();
40 var path = eventObj.path;
41 debug(path);
42
43 testPassed('totally did not crash.');
44 finishJSTest();
45 }
46 </script>
47 </body>
48 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698