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

Side by Side Diff: third_party/WebKit/PerformanceTests/CSS/StyleSheetInsert-bootstrap.html

Issue 2684483002: Ensure StyleSheetInsert-bootstrap.html doesn't spam willInsertBody IPCs (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | 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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../resources/runner.js"></script> 4 <script src="../resources/runner.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <iframe></iframe> 7 <iframe></iframe>
8 </body> 8 </body>
9 <script> 9 <script>
10 function loadText(path) { 10 function loadText(path) {
11 var xhr = new XMLHttpRequest(); 11 var xhr = new XMLHttpRequest();
12 xhr.open("GET", path, false); 12 xhr.open("GET", path, false);
13 xhr.send(null); 13 xhr.send(null);
14 return xhr.responseText; 14 return xhr.responseText;
15 } 15 }
16 var styleText = loadText("resources/bootstrap.min.css"); 16 var styleText = loadText("resources/bootstrap.min.css");
17 17
18 PerfTestRunner.measureRunsPerSecond({ 18 PerfTestRunner.measureRunsPerSecond({
19 description: "Measures performance of inserting a style elemenet ocntaining bootstrap's CSS into an iframe.", 19 description: "Measures performance of inserting a style elemenet ocntaining bootstrap's CSS into an iframe.",
20 run:function() { 20 run:function() {
21 var testDoc = document.getElementsByTagName("iframe")[0].contentDocument ; 21 var testDoc = document.getElementsByTagName("iframe")[0].contentDocument ;
22 testDoc.documentElement.innerHTML = "";
23 var style = testDoc.createElement("style"); 22 var style = testDoc.createElement("style");
24 style.textContent = styleText; 23 style.textContent = styleText;
25 testDoc.documentElement.appendChild(style); 24 testDoc.documentElement.appendChild(style);
25 testDoc.documentElement.removeChild(testDoc.documentElement.lastElementC hild);
26 } 26 }
27 }); 27 });
28 </script> 28 </script>
29 </html> 29 </html>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698