summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/manual-tests/memory/xhr-repeated-string-access.xml
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/manual-tests/memory/xhr-repeated-string-access.xml')
-rw-r--r--Source/WebCore/manual-tests/memory/xhr-repeated-string-access.xml43
1 files changed, 43 insertions, 0 deletions
diff --git a/Source/WebCore/manual-tests/memory/xhr-repeated-string-access.xml b/Source/WebCore/manual-tests/memory/xhr-repeated-string-access.xml
new file mode 100644
index 0000000..efb8e35
--- /dev/null
+++ b/Source/WebCore/manual-tests/memory/xhr-repeated-string-access.xml
@@ -0,0 +1,43 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+ <title>Massive Memory Leak</title>
+ <script>
+ <![CDATA[
+
+ function loadVideo (videoURI) {
+ var xhr = new XMLHttpRequest();
+ xhr.open('GET', videoURI, true);
+ xhr.onreadystatechange = function (xhrEvent) {
+ if (xhr.readyState == 3) {
+ var currentLength = xhr.responseText.length;
+ var totalLength = parseInt(xhr.getResponseHeader('Content-Length'), 10);
+ print((Math.round((currentLength / totalLength) * 10000) / 100) + '%');
+ }
+ else if (xhr.readyState == 4) {
+ if (xhr.status == 200) {
+ alert('done loading');
+ alert(xhr.responseText.length);
+ }
+ else {
+ alert('NOK');
+ }
+ }
+ };
+ xhr.send(null);
+ }
+
+ function print (message) {
+ document.getElementById('outlet').textContent = message;
+ }
+
+ ]]>
+ </script>
+ </head>
+
+ <body>
+ <a onclick="loadVideo('http://streamos.atlrec.com/download/atlantic/bjork/video/bjork_itunes1.m4v');">do it!</a>
+ <p id="outlet" />
+ </body>
+
+</html>