Bug 52654 - Add a test that calling window.open with an empty URL does not trigger an assertion or cause a crash
Summary: Add a test that calling window.open with an empty URL does not trigger an ass...
Status: REOPENED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Jessie Berlin
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-01-18 12:56 PST by Jessie Berlin
Modified: 2011-01-24 12:16 PST (History)
5 users (show)

See Also:


Attachments
Patch (2.28 KB, patch)
2011-01-18 12:59 PST, Jessie Berlin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jessie Berlin 2011-01-18 12:56:48 PST
In http://trac.webkit.org/changeset/76040 I removed some asserts that were getting triggered by calling window.open with an empty URL, but failed to add a test.
Comment 1 Jessie Berlin 2011-01-18 12:59:29 PST
Created attachment 79315 [details]
Patch
Comment 2 Jessie Berlin 2011-01-18 13:01:03 PST
(Added the link to the bug to the ChangeLog)
Comment 3 Adam Roben (:aroben) 2011-01-18 13:08:32 PST
Comment on attachment 79315 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=79315&action=review

> LayoutTests/fast/dom/Window/open-window-empty-url.html:1
> +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">

Just <!DOCTYPE html> should be enough. That's what HTML5 recommends.

> LayoutTests/fast/dom/Window/open-window-empty-url.html:21
> +    <script type="text/javascript">
> +        if (window.layoutTestController) {
> +            layoutTestController.dumpAsText();
> +            layoutTestController.waitUntilDone();
> +            layoutTestController.setCanOpenWindows();
> +        }
> +        var newWindow = window.open("");
> +        newWindow.close();
> +        document.getElementById("results").innerText = "PASS: Calling window.open() with an empty URL did not trigger any assertions or cause any crashes.";
> +        if (window.layoutTestController)
> +            layoutTestController.notifyDone();
> +    </script>
> +</body>

Since the whole test proceeds synchronously (before the page has even finished loading), there's no need for waitUntilDone/notifyDone.
Comment 4 Jessie Berlin 2011-01-18 17:07:50 PST
(In reply to comment #3)
> (From update of attachment 79315 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=79315&action=review
> 
> > LayoutTests/fast/dom/Window/open-window-empty-url.html:1
> > +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
> 
> Just <!DOCTYPE html> should be enough. That's what HTML5 recommends.

Done.

> 
> > LayoutTests/fast/dom/Window/open-window-empty-url.html:21
> > +    <script type="text/javascript">
> > +        if (window.layoutTestController) {
> > +            layoutTestController.dumpAsText();
> > +            layoutTestController.waitUntilDone();
> > +            layoutTestController.setCanOpenWindows();
> > +        }
> > +        var newWindow = window.open("");
> > +        newWindow.close();
> > +        document.getElementById("results").innerText = "PASS: Calling window.open() with an empty URL did not trigger any assertions or cause any crashes.";
> > +        if (window.layoutTestController)
> > +            layoutTestController.notifyDone();
> > +    </script>
> > +</body>
> 
> Since the whole test proceeds synchronously (before the page has even finished loading), there's no need for waitUntilDone/notifyDone.

Removed.

Thanks for the review!
Comment 5 Jessie Berlin 2011-01-18 17:14:25 PST
Comment on attachment 79315 [details]
Patch

Committed in r76084
http://trac.webkit.org/changeset/76084
Comment 6 Eric Seidel (no email) 2011-01-18 22:04:48 PST
This test crashes on the bots.
Comment 7 Eric Seidel (no email) 2011-01-18 22:05:11 PST
Build 23847 (r76085) was the first to show failures: set([u'fast/dom/Window/open-window-empty-url.html'])
Comment 8 Eric Seidel (no email) 2011-01-18 22:09:41 PST
Reverted r76084 for reason:

Crashes on the bots

Committed r76102: <http://trac.webkit.org/changeset/76102>
Comment 9 Eric Seidel (no email) 2011-01-18 22:10:23 PST
It's always sad to roll out a test case, but it seems the bug wasn't actually fixed before this test was added. :(
Comment 10 Adam Roben (:aroben) 2011-01-19 05:09:09 PST
(In reply to comment #8)
> Reverted r76084 for reason:
> 
> Crashes on the bots
> 
> Committed r76102: <http://trac.webkit.org/changeset/76102>

Thanks for rolling it out. Which bots was it crashing on?
Comment 11 WebKit Review Bot 2011-01-19 06:09:00 PST
http://trac.webkit.org/changeset/76084 might have broken Chromium Linux Release
Comment 12 Eric Seidel (no email) 2011-01-19 10:54:20 PST
Leopard and Snow Leopard iirc.  Sorry for not writing that in my rollout text.
Comment 13 Jessie Berlin 2011-01-24 12:16:44 PST
<rdar://problem/8908391>