RESOLVED FIXED172671
Add unit test for WebKit2 C SPI runBeforeUnloadConfirmPanel()
https://bugs.webkit.org/show_bug.cgi?id=172671
Summary Add unit test for WebKit2 C SPI runBeforeUnloadConfirmPanel()
Daniel Bates
Reported 2017-05-26 16:53:24 PDT
We should add a unit test to ensure that we do not regress the WKPageUIClient runBeforeUnloadConfirmPanel() callback. Although we want to eventually remove the WebKit2 C SPI this is unlikely to happen immediately and there is value in adding testing coverage to ensure we do not cause regressions for existing clients.
Attachments
Unit test (5.48 KB, patch)
2017-05-26 16:55 PDT, Daniel Bates
achristensen: review+
Daniel Bates
Comment 1 2017-05-26 16:55:18 PDT
Created attachment 311398 [details] Unit test
Alex Christensen
Comment 2 2017-05-26 17:42:14 PDT
Comment on attachment 311398 [details] Unit test View in context: https://bugs.webkit.org/attachment.cgi?id=311398&action=review > Tools/ChangeLog:8 > + We should add a unit test to ensure we do not regress the WKPageUIClient runBeforeUnloadConfirmPanel() callback. Could you add a reference to the revision this is intended to test? > Tools/TestWebKitAPI/Tests/WebKit2/ModalAlertsSPI.cpp:54 > + if (securityOrigin) { Was this always non-null before? Why did it change?
Daniel Bates
Comment 3 2017-05-26 18:06:55 PDT
Comment on attachment 311398 [details] Unit test View in context: https://bugs.webkit.org/attachment.cgi?id=311398&action=review >> Tools/TestWebKitAPI/Tests/WebKit2/ModalAlertsSPI.cpp:54 >> + if (securityOrigin) { > > Was this always non-null before? Why did it change? Please disregard this change. Will revert it before landing. securityOrigin is always non-null.
Daniel Bates
Comment 4 2017-05-26 18:09:37 PDT
Comment on attachment 311398 [details] Unit test View in context: https://bugs.webkit.org/attachment.cgi?id=311398&action=review >> Tools/ChangeLog:8 >> + We should add a unit test to ensure we do not regress the WKPageUIClient runBeforeUnloadConfirmPanel() callback. > > Could you add a reference to the revision this is intended to test? Adding this test is not part of a followup per-se. We never added a test for the runBeforeUnloadConfirmPanel callback since its inception (WKPageUIClientV0) :(
Daniel Bates
Comment 5 2017-05-30 14:10:36 PDT
(In reply to Daniel Bates from comment #3) > Comment on attachment 311398 [details] > Unit test > > View in context: > https://bugs.webkit.org/attachment.cgi?id=311398&action=review > > >> Tools/TestWebKitAPI/Tests/WebKit2/ModalAlertsSPI.cpp:54 > >> + if (securityOrigin) { > > > > Was this always non-null before? Why did it change? > > Please disregard this change. Will revert it before landing. securityOrigin > is always non-null. Wow, I was out of it. Keeping this change. Notice that we are not passed a security origin in the runBeforeUnloadConfirmPanel() callback. All other callbacks tested by this unit test are passed a security origin.
Daniel Bates
Comment 6 2017-05-30 14:13:02 PDT
Radar WebKit Bug Importer
Comment 7 2017-05-30 20:19:36 PDT
Note You need to log in before you can comment on or make changes to this bug.