Adding unit tests for bug #146306 in the GTK+ port I've noticed that patch for bug #146306 still doesn't work when a request is modified by willSendRequest after a redirect. The thing is that DocumentLoader::setRequest is not called after willSendRequest is called for a redirect. The first willSendRequest happens before DocumentLoader::startLoadingMainResource, that calls setRequest, but the second one happens after DocumentLoader::redirectReceived() and then the request is never updated again.
Created attachment 291595 [details] Patch Added unit tests for GTK+ only, because I'm not sure it's even possible to test a server redirect with the cross-platform C API unit tests.
(In reply to comment #1) > Created attachment 291595 [details] > Patch > > Added unit tests for GTK+ only, because I'm not sure it's even possible to > test a server redirect with the cross-platform C API unit tests. I think it's not currently possible, because we have no cross-platform equivalent to SoupServer.
Comment on attachment 291595 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=291595&action=review Great tests. > Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp:225 > + enum State { Provisional, ProvisionalAfterRedirect, Commited, Finished }; Personally, I'd still favor using enum class even in a file-private unit test class, but your call. > Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp:254 > + void checkURIAtState(State state, const char* uri) Please rename the second parameter (maybe to "path") because it's not a URI.
Committed r207388: <http://trac.webkit.org/changeset/207388>