diff options
author | hclam@google.com <hclam@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-22 20:49:21 +0000 |
---|---|---|
committer | hclam@google.com <hclam@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-22 20:49:21 +0000 |
commit | 842ffc55330e73a0a33ec9ea8facced86b348de5 (patch) | |
tree | 60f652f33a005891e665473fe9924ddd251bed85 /webkit/data/media | |
parent | f055adaf0e0acfadd3d947b30ad32ffddf267f1a (diff) | |
download | chromium_src-842ffc55330e73a0a33ec9ea8facced86b348de5.zip chromium_src-842ffc55330e73a0a33ec9ea8facced86b348de5.tar.gz chromium_src-842ffc55330e73a0a33ec9ea8facced86b348de5.tar.bz2 |
Additional test to exploit memory leaks in <video>
TEST=MediaLeakTest.ManyVideoBear
This test inject and remove a <video> element many (50) times.
Trying to exploit memory leaks during the creation and
destruction of the internal media player and the glue code
with WebKit.
Review URL: http://codereview.chromium.org/159204
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21317 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/data/media')
-rw-r--r-- | webkit/data/media/manybear.html | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/webkit/data/media/manybear.html b/webkit/data/media/manybear.html new file mode 100644 index 0000000..066c270 --- /dev/null +++ b/webkit/data/media/manybear.html @@ -0,0 +1,38 @@ +<html> +<body> +<div id="container"></div> +<script> + layoutTestController.waitUntilDone(); + + var count = 0; + var file = "bear_silent.ogv"; + + function loop() { + var c = document.getElementById('container'); + var v = null; + + if (c.childNodes != null && c.childNodes.length > 0) { + v = c.childNodes[0]; + } + + // If there is a video tag as child, remove it. + if (v) { + c.removeChild(v); + window.setTimeout(function () { loop(); }, 0); + } else { + v = document.createElement("video"); + c.appendChild(v); + v.src = file; + v.addEventListener("load", function () { loop(); }, false); + v.load(); + } + + if (count++ == 50) { + layoutTestController.notifyDone(); + } + } + + loop(); +</script> +</body> +</html> |