2 <p>Test Media object lifetime.</p>
3 <div id=result>Testing...</div>
4 <iframe src="about:blank"></iframe>
6 if (window.layoutTestController) {
7 layoutTestController.dumpAsText();
8 layoutTestController.waitUntilDone();
13 if (window.GCController)
14 return GCController.collect();
16 for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
17 var s = new String("abc");
23 if (!window.styleMedia) {
24 document.getElementById("result").innerHTML = "FAIL - window.styleMedia is not supported.";
28 styleMedia.foo = "bar";
30 if (styleMedia.foo != "bar") {
31 document.getElementById("result").innerHTML = "FAIL - window.styelMedia doesn't return the same object each time.";
35 var m = frames[0].styleMedia;
36 document.body.removeChild(document.getElementsByTagName("iframe")[0]);
37 try { m.matchMedium("foobar") } catch (ex) { }
38 setTimeout(function() {
40 try { m.matchMedium("foobar") } catch (ex) { }
41 document.getElementById("result").innerHTML = "PASS";
42 if (window.layoutTestController)
43 layoutTestController.notifyDone();