Need an API test for bug #133193 (r169315)
authorjhoneycutt@apple.com <jhoneycutt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 May 2014 19:21:11 +0000 (19:21 +0000)
committerjhoneycutt@apple.com <jhoneycutt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 May 2014 19:21:11 +0000 (19:21 +0000)
commit51b4355c9582ad2e2367d8c3d5f808009eeab8a8
tree5a91966d095c894c81dc9cbdaae1d37448f7b526
parent355672d7a84283296b8053d95defb9a20cd00cd5
Need an API test for bug #133193 (r169315)
<https://bugs.webkit.org/show_bug.cgi?id=133324>

This adds an API test that ensures that calling "stop loading" during a
"did fail provisional load" callback doesn't crash.

Reviewed by Andy Estes.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
Add new files to project.

* TestWebKitAPI/Tests/WebKit2/StopLoadingDuringDidFailProvisionalLoad.cpp: Added.
(TestWebKitAPI::didReceiveMessageFromInjectedBundle):
If the message is the "test done" message, record that.
(TestWebKitAPI::setInjectedBundleClient):
Register a function for the "did receive message from injected bundle"
callback.
(TestWebKitAPI::didFailProvisionalLoadWithErrorForFrame):
Assert that we received the message from the injected bundle, and set
'done' to finish the test.
(TestWebKitAPI::TEST):
Create a WebView, register a page loader client for the "did fail
provisional load" callback, and load a non-existent resource.

* TestWebKitAPI/Tests/WebKit2/StopLoadingDuringDidFailProvisionalLoad_bundle.cpp: Added.
(TestWebKitAPI::StopLoadingDuringDidFailProvisionalLoadTest::StopLoadingDuringDidFailProvisionalLoadTest):
(TestWebKitAPI::didFailProvisionalLoadWithErrorForFrameCallback):
Tell the StopLoadingDuringDidFailProvisionalLoadTest object that the
provisional load failed.
(TestWebKitAPI::StopLoadingDuringDidFailProvisionalLoadTest::didCreatePage):
Register a page loader client for the "did fail provisional load"
callback.
(TestWebKitAPI::StopLoadingDuringDidFailProvisionalLoadTest::didFailProvisionalLoad):
Call WKBundlePageStopLoading() during the callback. This not crashing
is what we're ensuring with this test.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169429 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKit2/StopLoadingDuringDidFailProvisionalLoad.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit2/StopLoadingDuringDidFailProvisionalLoad_bundle.cpp [new file with mode: 0644]