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

Side by Side Diff: LayoutTests/fast/css/visited-link-hang.html

Issue 38293002: Explicit GC of strings to avoid test timeout. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on top of CRLF -> LF change. Created 7 years, 1 month 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
« no previous file with comments | « LayoutTests/fast/css/giant-stylesheet-crash.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <p>If this test runs without hanging, then it has passed. The visited link hash algorithm was N^2 at one point and would hang.</p> 1 <p>If this test runs without hanging, then it has passed. The visited link hash algorithm was N^2 at one point and would hang.</p>
2 <p id="test1"></p> 2 <p id="test1"></p>
3 <p id="test2"></p> 3 <p id="test2"></p>
4 <p id="test3"></p> 4 <p id="test3"></p>
5 <p id="result">TEST DID NOT RUN YET</p> 5 <p id="result">TEST DID NOT RUN YET</p>
6 6
7 <script> 7 <script>
8 8
9 if (window.testRunner) 9 if (window.testRunner)
10 testRunner.dumpAsText(); 10 testRunner.dumpAsText();
11 11
12 var oneMillionSlashes = ""; 12 var oneMillionSlashes = "";
13 for (i = 0; i < 1000000; ++i) 13 for (i = 0; i < 1000000; ++i)
14 oneMillionSlashes += "/"; 14 oneMillionSlashes += "/";
15 15
16 var oneMillionSlashesAndDots = ""; 16 var oneMillionSlashesAndDots = "";
17 for (i = 0; i < 333334; ++i) 17 for (i = 0; i < 333334; ++i)
18 oneMillionSlashesAndDots += "/./"; 18 oneMillionSlashesAndDots += "/./";
19 19
20 var oneMillionSlashesAndDoubleDots = ""; 20 var oneMillionSlashesAndDoubleDots = "";
21 for (i = 0; i < 250000; ++i) 21 for (i = 0; i < 250000; ++i)
22 oneMillionSlashesAndDoubleDots += "/../"; 22 oneMillionSlashesAndDoubleDots += "/../";
23 23
24 document.getElementById("test1").innerHTML = '<a href="about:test?slashes' + one MillionSlashes + '">Link with tons of slashes</a>'; 24 document.getElementById("test1").innerHTML = '<a href="about:test?slashes' + one MillionSlashes + '">Link with tons of slashes</a>';
25 document.getElementById("test2").innerHTML = '<a href="about:test?slashes' + one MillionSlashesAndDots + '">Link with tons of slashes with dots</a>'; 25 document.getElementById("test2").innerHTML = '<a href="about:test?slashes' + one MillionSlashesAndDots + '">Link with tons of slashes with dots</a>';
26 document.getElementById("test3").innerHTML = '<a href="about:test?slashes' + one MillionSlashesAndDoubleDots + '">Link with tons of slashes with double dots</a>' ; 26 document.getElementById("test3").innerHTML = '<a href="about:test?slashes' + one MillionSlashesAndDoubleDots + '">Link with tons of slashes with double dots</a>' ;
27 27
28 // GC these large strings so that they don't cause the next test to timeout.
29 if (window.GCController) {
30 oneMillionSlashes = null;
31 oneMillionSlashesAndDots = null;
32 oneMillionSlashesAndDoubleDots = null;
33 GCController.collect();
34 }
35
28 document.getElementById("result").firstChild.data = "TEST PASSED"; 36 document.getElementById("result").firstChild.data = "TEST PASSED";
29
30 </script> 37 </script>
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/giant-stylesheet-crash.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698