LayoutTests:
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Aug 2006 03:52:34 +0000 (03:52 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Aug 2006 03:52:34 +0000 (03:52 +0000)
        Test case not reviewed but the patch was reviewed by Tim Omernick.

        - test case for REGRESSION: crash when leaving youtube page while movie is still loading
        http://bugzilla.opendarwin.org/show_bug.cgi?id=10398

        * http/tests/plugins/interrupted-get-url.html: Added.
        * http/tests/plugins/resources/interrupted-get-url-success.html: Added.
        * http/tests/plugins/resources/slow-resource.pl: Added.

WebKit:

        Reviewed by Tim Omernick.

        - fixed REGRESSION: crash when leaving youtube page while movie is still loading
        http://bugzilla.opendarwin.org/show_bug.cgi?id=10398

        * Loader/WebNetscapePlugInStreamLoader.m:
        (-[WebNetscapePlugInStreamLoader initWithStream:view:]): Set the frame loader for this stream.
        (-[WebNetscapePlugInStreamLoader cancelWithError:]): Make sure to destroy the stream as well;
        otherwise, when we try to clean up later, we won't have the right context.

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

LayoutTests/ChangeLog
LayoutTests/http/tests/plugins/interrupted-get-url.html [new file with mode: 0644]
LayoutTests/http/tests/plugins/resources/interrupted-get-url-success.html [new file with mode: 0644]
LayoutTests/http/tests/plugins/resources/slow-resource.pl [new file with mode: 0755]
WebKit/ChangeLog
WebKit/Loader/WebNetscapePlugInStreamLoader.m

index 05f86353e72253bb8a50ccfe24684f80fe5daeeb..4d95b3587eff49fb565813c74359bc97c4028e3c 100644 (file)
@@ -1,3 +1,14 @@
+2006-08-14  Maciej Stachowiak  <mjs@apple.com>
+
+        Test case not reviewed but the patch was reviewed by Tim Omernick.
+        
+        - test case for REGRESSION: crash when leaving youtube page while movie is still loading
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=10398
+
+        * http/tests/plugins/interrupted-get-url.html: Added.
+        * http/tests/plugins/resources/interrupted-get-url-success.html: Added.
+        * http/tests/plugins/resources/slow-resource.pl: Added.
+
 2006-08-14  Darin Adler  <darin@apple.com>
 
         Reviewed by John Sullivan.
diff --git a/LayoutTests/http/tests/plugins/interrupted-get-url.html b/LayoutTests/http/tests/plugins/interrupted-get-url.html
new file mode 100644 (file)
index 0000000..43c7e14
--- /dev/null
@@ -0,0 +1,17 @@
+<html>
+<body>
+FAILURE
+<embed name="plg" type="application/x-webkit-test-netscape"></embed>
+<script>
+    if (window.layoutTestController) {
+        layoutTestController.dumpAsText();
+        layoutTestController.waitUntilDone();
+    }
+
+    plg.getURL("resources/slow-resource.pl");
+    
+    setTimeout(function() { window.location = "resources/interrupted-get-url-success.html";  }, 200);
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/plugins/resources/interrupted-get-url-success.html b/LayoutTests/http/tests/plugins/resources/interrupted-get-url-success.html
new file mode 100644 (file)
index 0000000..251fe00
--- /dev/null
@@ -0,0 +1,6 @@
+SUCCESS
+<script>
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();
+</script>
+
diff --git a/LayoutTests/http/tests/plugins/resources/slow-resource.pl b/LayoutTests/http/tests/plugins/resources/slow-resource.pl
new file mode 100755 (executable)
index 0000000..e854beb
--- /dev/null
@@ -0,0 +1,24 @@
+#!/usr/bin/perl -w
+
+# flush the buffers after each print
+select (STDOUT);
+$| = 1;
+
+print "Content-Type: text/plain\n";
+print "Expires: Thu, 01 Dec 2003 16:00:00 GMT\n";
+print "Cache-Control: no-store, no-cache, must-revalidate\n";
+print "Pragma: no-cache\n";
+print "\n";
+
+print "\xef\xbb\xbfTest for bug 5187: UTF-8 in long text files breaks at some point.\n\n";
+for ($count=1; $count<2000; $count++) {
+    print "\x65\xcc\x81";
+}
+sleep 10;
+for ($count=1; $count<2000; $count++) {
+    print "\x65\xcc\x81";
+}
+sleep 10;
+for ($count=1; $count<2000; $count++) {
+    print "\x65\xcc\x81";
+}
index 31c9eed04e49c7741a8f72da6dd77b686cb5fc7e..f14011b9f877ab3a6fd868496483528fab1c201c 100644 (file)
@@ -1,3 +1,15 @@
+2006-08-14  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Tim Omernick.
+        
+        - fixed REGRESSION: crash when leaving youtube page while movie is still loading
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=10398
+
+        * Loader/WebNetscapePlugInStreamLoader.m:
+        (-[WebNetscapePlugInStreamLoader initWithStream:view:]): Set the frame loader for this stream.
+        (-[WebNetscapePlugInStreamLoader cancelWithError:]): Make sure to destroy the stream as well;
+        otherwise, when we try to clean up later, we won't have the right context.
+
 2006-08-14  David Hyatt  <hyatt@apple.com>
 
         Fix for Radar bug 4478840, Safari should not reduce null events sent to
index ae2a32edf049448ee01c1e5bb655f4998e0b2183..0db41eda3dd92d1cc82ce6c143aa6d7aa65baba7 100644 (file)
 
 #import <WebKit/WebNetscapePluginStream.h>
 #import <WebKit/WebKitErrorsPrivate.h>
+#import <WebKit/WebFrameInternal.h>
 
 @implementation WebNetscapePlugInStreamLoader
 
-- initWithStream:(WebNetscapePluginStream *)theStream view:(WebBaseNetscapePluginView *)theView
+- (id)initWithStream:(WebNetscapePluginStream *)theStream view:(WebBaseNetscapePluginView *)theView
 {
     [super init];
     stream = [theStream retain];
     view = [theView retain];
+    [self setFrameLoader:[[theView webFrame] _frameLoader]];
     return self;
 }
 
     [self retain];
 
     [[self frameLoader] _removePlugInStreamLoader:self];
+    [stream destroyStreamWithError:error];
     [super cancelWithError:error];
 
     [self release];