LayoutTests:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 May 2006 04:29:22 +0000 (04:29 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 May 2006 04:29:22 +0000 (04:29 +0000)
        Reviewed by Darin.

        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8594
          REGRESSION: Exception on closing a page containing (just) an mp3

        * plugins/pluginDocumentView-deallocated-dataSource-expected.txt: Added.
        * plugins/pluginDocumentView-deallocated-dataSource.html: Added.
        * plugins/resources: Added.
        * plugins/resources/orange.mov: Added.

WebKit:

        Reviewed by Darin.

        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8594
          REGRESSION: Exception on closing a page containing (just) an mp3

        Test: plugins/pluginDocumentView-deallocated-dataSource.html

        * Plugins/WebPluginDocumentView.m:
        (-[WebPluginDocumentView dealloc]): Release the dataSource.
        (-[WebPluginDocumentView setDataSource:]): Retain the dataSource.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14201 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/plugins/pluginDocumentView-deallocated-dataSource-expected.txt [new file with mode: 0644]
LayoutTests/plugins/pluginDocumentView-deallocated-dataSource.html [new file with mode: 0644]
LayoutTests/plugins/resources/orange.mov [new file with mode: 0644]
WebKit/ChangeLog
WebKit/Plugins/WebPluginDocumentView.m

index 08d3dea3a8d3f1b3b26cb456121104a8e60741e8..bd0e73ce2cd05bb4c54a872340c178c6fe3e4cfe 100644 (file)
@@ -1,3 +1,15 @@
+2006-05-04  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by Darin.
+
+        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8594
+          REGRESSION: Exception on closing a page containing (just) an mp3
+
+        * plugins/pluginDocumentView-deallocated-dataSource-expected.txt: Added.
+        * plugins/pluginDocumentView-deallocated-dataSource.html: Added.
+        * plugins/resources: Added.
+        * plugins/resources/orange.mov: Added.
+
 2006-05-04  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by harrison
diff --git a/LayoutTests/plugins/pluginDocumentView-deallocated-dataSource-expected.txt b/LayoutTests/plugins/pluginDocumentView-deallocated-dataSource-expected.txt
new file mode 100644 (file)
index 0000000..080d2e6
--- /dev/null
@@ -0,0 +1,5 @@
+Test for regression against http://bugzilla.opendarwin.org/show_bug.cgi?id=8594 REGRESSION: Exception on closing a page containing (just) an mp3.
+
+No crash (or exception) means PASS.
+
+
diff --git a/LayoutTests/plugins/pluginDocumentView-deallocated-dataSource.html b/LayoutTests/plugins/pluginDocumentView-deallocated-dataSource.html
new file mode 100644 (file)
index 0000000..1af9c24
--- /dev/null
@@ -0,0 +1,45 @@
+<html>
+<head>
+<script>
+function finishTest()
+{
+    document.getElementById('plugin').src = 'about:blank';
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();
+}
+
+function test()
+{
+    if (window.layoutTestController) {
+        layoutTestController.waitUntilDone();
+        layoutTestController.dumpAsText();
+    }
+
+    var i = 0;
+    var found = false;
+    while (!found && i < navigator.plugins.length) {
+        if (navigator.plugins[i].filename == "QuickTime Plugin.webplugin")
+            found = true;
+        i++;
+    }
+    if (!found) {
+        document.getElementById("result").innerText = "Test cannot run: QuickTime Plugin.webplugin missing.";
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+        return;
+    }
+    setTimeout(finishTest, 0);
+}
+</script>
+</head>
+<body onload="test();">
+<p>
+    Test for regression against <i><a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=8594">http://bugzilla.opendarwin.org/show_bug.cgi?id=8594</a>
+    REGRESSION: Exception on closing a page containing (just) an mp3</i>.
+</p>
+<p id="result">
+    No crash (or exception) means PASS.
+</p>
+<iframe id="plugin" src="resources/orange.mov"></iframe>
+</body>
+</html>
diff --git a/LayoutTests/plugins/resources/orange.mov b/LayoutTests/plugins/resources/orange.mov
new file mode 100644 (file)
index 0000000..a17e81b
Binary files /dev/null and b/LayoutTests/plugins/resources/orange.mov differ
index ee261488da1df09ede9ac5ecd159d84af10ddc2d..8a97238e77778666b0e9d0b9fbf9a8f06b7d042f 100644 (file)
@@ -1,3 +1,16 @@
+2006-05-04  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by Darin.
+
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8594
+          REGRESSION: Exception on closing a page containing (just) an mp3
+
+        Test: plugins/pluginDocumentView-deallocated-dataSource.html
+
+        * Plugins/WebPluginDocumentView.m:
+        (-[WebPluginDocumentView dealloc]): Release the dataSource.
+        (-[WebPluginDocumentView setDataSource:]): Retain the dataSource.
+
 2006-05-04  Tim Omernick  <timo@apple.com>
 
         Reviewed by Darin.
index c3d43e3fee86ebdcb6bdaa7826b66b8d3e2b4978..1ccacefe29d5fcaf7bc8b114e3cb6d3d191a5e13 100644 (file)
@@ -60,6 +60,7 @@
     [plugin release];
     [pluginController destroyAllPlugins];
     [pluginController release];
+    [_dataSource release];
     [super dealloc];
 }
 
@@ -84,7 +85,7 @@
     if (![self superview])
         return;
         
-    _dataSource = dataSource;
+    _dataSource = [dataSource retain];
     [pluginController setDataSource:dataSource];
     dataSourceHasBeenSet = YES;