TL;DR do we ensure that the network request for an image object created in unload will actually be kept alive?
This CL is moving the image-ping test to use pagehide instead of unload. This test creates an image in the unload handler and tests that the network request to fetch the image is received by the server.
There's consensus for allowing images loaded in unload handlers to outlive the page, in order to maintain compatibility with IE. This hack is used by a bunch of ad networks for tracking purposes. Since the image doesn't currently outlive the page, they resort to simulating sleep() in JavaScript by busy looping. By letting the image load outlive the page, the goal is that web developers won't resort to such hacks which hurt the user.
It looks like in the bug some code was changed to ensure this.
However, since the test is being renamed it is now subjected to the flaky test detector for new tests, which says that it is flaky. I already removed 1 source of flakiness with
this CL. This has resulted in green runs on windows and linux but mac is still failing. I can't think of any other source of flakiness except that we just don't truly support this use-case and that sometimes the network request doesn't make it.
Does the code still exist? Was it dropped when sendBeacon/keep-alive became an option? Should we actually be testing this?
F