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

Unified Diff: chrome/test/data/chrome_endure/endurance_control.html

Issue 9561010: Add a control test for Chrome Endure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/functional/perf_endure.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/chrome_endure/endurance_control.html
diff --git a/chrome/test/data/chrome_endure/endurance_control.html b/chrome/test/data/chrome_endure/endurance_control.html
new file mode 100644
index 0000000000000000000000000000000000000000..72a024e75d00484b15f89cfb1b062f55b0d66031
--- /dev/null
+++ b/chrome/test/data/chrome_endure/endurance_control.html
@@ -0,0 +1,48 @@
+<!--
+ This file is used as a control test to compare with the other Chrome Endure
+ tests in perf_endure.py.
+
+ This file creates a large DOM tree in the live document that also contains
+ event listeners. It then detaches the tree at the root. Since no JS
+ reference is kept, the tree should be collected by v8 at some point in the
+ future. As a result, if graphing DOM node and event listener count over time,
+ we expect to see a "sawtooth" pattern that does not show any overall tendency
+ to increase.
+-->
+
+<html>
+ <head>
+ <script type='text/javascript'>
+ function start_tests() {
+ run_detached_dom_test();
+ }
+
+ function run_detached_dom_test() {
+ var last_node = document.createElement('div');
+ var root_node = last_node;
+ for (i=0; i<1000; i++) {
+ var node = document.createElement('div');
+ node.innerHTML = 'Node ' + i;
+ node.addEventListener('mousemove', mouse_move_callback, true);
+ last_node.appendChild(node);
+ last_node = node;
+ }
+ document.body.appendChild(root_node);
+ setTimeout('run_detached_dom_test2()', 500);
+ }
+
+ function run_detached_dom_test2() {
+ // Detach the dom tree that was just created.
+ document.body.removeChild(document.body.firstChild);
+ setTimeout('run_detached_dom_test()', 500)
+ }
+
+ function mouse_move_callback(event) {
+ // Stub.
+ }
+ </script>
+ <title>Chrome Endure Control Test</title>
+ </head>
+ <body onload='start_tests()'>
+ </body>
+</html>
« no previous file with comments | « no previous file | chrome/test/functional/perf_endure.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698