Source/WebKit2: Add API to get the parent frame in WKBundleFrameRef
https://bugs.webkit.org/show_bug.cgi?id=77161
Reviewed by Anders Carlsson.
* WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
(WKBundleFrameGetParentFrame): Get the parent frame by calling WebFrame::parentFrame().
* WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::parentFrame): Return null if the frame does not have an owner element.
Otherwise, return the owner element's frame.
* WebProcess/WebPage/WebFrame.h:
Tools: Add test for WKBundleFrameGetParentFrame().
https://bugs.webkit.org/show_bug.cgi?id=77161
Reviewed by Anders Carlsson.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Add ParentFrame.cpp and ParentFrame_Bundle.cpp.
* TestWebKitAPI/Tests/WebKit2/ParentFrame.cpp: Added.
(TestWebKitAPI):
(TestWebKitAPI::didReceiveMessageFromInjectedBundle): Get the check result from the injected bundle.
(TestWebKitAPI::setInjectedBundleClient):
(TestWebKitAPI::TEST): Load simple-iframe.html and then wait for the injected bundle to post result.
Make sure the check is successful.
* TestWebKitAPI/Tests/WebKit2/ParentFrame_Bundle.cpp: Added.
(TestWebKitAPI):
(ParentFrameTest):
(TestWebKitAPI::ParentFrameTest::ParentFrameTest):
(TestWebKitAPI::didFinishLoadForFrame): If the frame is a subframe, store it off for checking later.
If the frame is the main frame, check whether it's indeed the subframe's parent frame and post the result
to the test controller.
(TestWebKitAPI::ParentFrameTest::didCreatePage): Set the page loader client on this page.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106139
268f45cc-cd09-0410-ab3c-
d52691b4dbfc