summaryrefslogtreecommitdiffstats
path: root/chrome/test/data/read_cookies.html
diff options
context:
space:
mode:
authorinitial.commit <initial.commit@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-26 23:55:29 +0000
committerinitial.commit <initial.commit@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-26 23:55:29 +0000
commit09911bf300f1a419907a9412154760efd0b7abc3 (patch)
treef131325fb4e2ad12c6d3504ab75b16dd92facfed /chrome/test/data/read_cookies.html
parent586acc5fe142f498261f52c66862fa417c3d52d2 (diff)
downloadchromium_src-09911bf300f1a419907a9412154760efd0b7abc3.zip
chromium_src-09911bf300f1a419907a9412154760efd0b7abc3.tar.gz
chromium_src-09911bf300f1a419907a9412154760efd0b7abc3.tar.bz2
Add chrome to the repository.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/data/read_cookies.html')
-rw-r--r--chrome/test/data/read_cookies.html35
1 files changed, 35 insertions, 0 deletions
diff --git a/chrome/test/data/read_cookies.html b/chrome/test/data/read_cookies.html
new file mode 100644
index 0000000..b457c34
--- /dev/null
+++ b/chrome/test/data/read_cookies.html
@@ -0,0 +1,35 @@
+<html>
+<body>
+<pre>
+<script>
+
+// This script tests the performance of reading cookies. It sets a cookie and
+// then reads cookies N times. Finally, it outputs the average time taken to
+// read the cookie.
+
+document.cookie =
+ 'one_heck_of_a_crazy_cookie_name=1234567890.1234567890.1234567890.1234567890';
+
+var ok = true;
+
+var num_iters = document.location.search.substring(1) - 0;
+if (num_iters == 0)
+ num_iters = 10000;
+document.writeln("num_iters: " + num_iters);
+
+var ts = (new Date()).getTime();
+
+// read the cookie num_iters times
+for (var i = 0; i < num_iters; ++i) {
+ var d = document.cookie;
+}
+
+var te = (new Date()).getTime();
+
+var time_per_read = (te - ts) / num_iters;
+document.writeln("time per read: " + time_per_read.toFixed(3) + " msec");
+
+</script>
+</pre>
+</body>
+</html>