Bug 32761 - upstream LayoutTests/http/tests/misc/set-window-opener-to-null.html
Summary: upstream LayoutTests/http/tests/misc/set-window-opener-to-null.html
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Dirk Pranke
Depends on:
Reported: 2009-12-18 18:27 PST by Dirk Pranke
Modified: 2009-12-21 20:31 PST (History)
6 users (show)

See Also:

Patch (3.44 KB, patch)
2009-12-18 18:28 PST, Dirk Pranke
no flags Details | Formatted Diff | Diff
Patch (3.05 KB, patch)
2009-12-21 15:37 PST, Dirk Pranke
no flags Details | Formatted Diff | Diff
Patch (3.39 KB, patch)
2009-12-21 17:54 PST, Dirk Pranke
abarth: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Pranke 2009-12-18 18:27:18 PST
upstreaming a test from Chromium.org - it seems to rely on some Chromium-specific timing issues, so I'm putting it in platform/chromium for now.
Comment 1 Dirk Pranke 2009-12-18 18:28:10 PST
Created attachment 45216 [details]
Comment 2 WebKit Review Bot 2009-12-18 18:31:47 PST
style-queue ran check-webkit-style on attachment 45216 [details] without any errors.
Comment 3 Eric Seidel (no email) 2009-12-19 11:56:15 PST
Looks OK.  Seems we might want some sort of comment in the test that it need not be chromium specific.
Comment 4 Dirk Pranke 2009-12-21 15:37:54 PST
Created attachment 45355 [details]
Comment 5 Dirk Pranke 2009-12-21 15:39:23 PST
Actually, it looks like it's not a platform-specific test, so I've revised the patch (which is good, because run_webkit_tests isn't set up to handle platform-specific http tests)
Comment 6 WebKit Review Bot 2009-12-21 15:42:33 PST
style-queue ran check-webkit-style on attachment 45355 [details] without any errors.
Comment 7 Adam Barth 2009-12-21 15:44:57 PST
Comment on attachment 45355 [details]

 22     // We might want to change it to using postMessage when it
 23     // is supported.

postMessage is supported.  Can we use that instead of polling?
Comment 8 Dirk Pranke 2009-12-21 17:52:06 PST
okay, it looks like the key thing is simply to check whether or not window.opener stays null.

Unfortunately, there doesn't seem to be a way to do this without using some 
sort of a timeout or a poll, since by setting window.opener to NULL, we prevent the target window from having a handle to the source. So, the source window has to send a message to the target, giving it a reference. But, if you post a message immediately after window.open(), the message gets dropped on the floor because the target window hasn't initialized yet. Sigh.

Anyway, revised patch uploaded.
Comment 9 Dirk Pranke 2009-12-21 17:54:31 PST
Created attachment 45361 [details]
Comment 10 Adam Barth 2009-12-21 18:03:38 PST
Comment on attachment 45361 [details]

I actually like the previous version better.  Julie will kill me if we land this one.
Comment 11 Dirk Pranke 2009-12-21 18:30:05 PST
heh. At least I got to spend some time learning how to use PostMessage() as a result of this ...
Comment 12 Adam Barth 2009-12-21 18:43:15 PST
Sorry for the wild goose chase.  :(
Comment 13 WebKit Commit Bot 2009-12-21 20:31:23 PST
Comment on attachment 45355 [details]

Clearing flags on attachment: 45355

Committed r52477: <http://trac.webkit.org/changeset/52477>
Comment 14 WebKit Commit Bot 2009-12-21 20:31:29 PST
All reviewed patches have been landed.  Closing bug.