Add WKTR support for "should open external URLs".
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Jun 2015 19:57:16 +0000 (19:57 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Jun 2015 19:57:16 +0000 (19:57 +0000)
commit48e3d2fe2fdd4db6bed238fe0797cbaa83680e5e
tree2e97534c4c4dea6222ad1fd4c8af476439a37ccb
parentf44e667ebefe56e91660ea0024f616891a40c39f
Add WKTR support for "should open external URLs".
https://bugs.webkit.org/show_bug.cgi?id=145505

Reviewed by Darin Adler.

Source/WebKit2:

Expose C-spi to allow WKTR to set this bit on new loads:
* UIProcess/API/C/WKPage.cpp:
(WKPageLoadURLWithShouldOpenExternalURLsPolicy):
* UIProcess/API/C/WKPagePrivate.h:

Expose the bit on NavigationAction for the policy delegate:
* WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:
(WKBundleNavigationActionGetShouldOpenExternalURLs):
* WebProcess/InjectedBundle/API/c/WKBundleNavigationActionPrivate.h: Copied from Tools/WebKitTestRunner/WorkQueueManager.h.

* WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
(WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
* WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
(WebKit::InjectedBundleNavigationAction::shouldOpenExternalURLs):

* WebKit2.xcodeproj/project.pbxproj:

Tools:

- Add a new option to "queueLoad" to allow javascript to queue a load that has the
  "should open external URLs" bit set.

- Add a new "dumpPolicyDelegateCallbacks" call to dump the NavigationAction in
  the policy delegate, including whether or not the bit was set.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::queueLoad):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
(WTR::TestRunner::dumpPolicyDelegateCallbacks):
(WTR::TestRunner::shouldDumpPolicyCallbacks):

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::queueLoad):
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::decidePolicyForNavigationAction):

* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):

* WebKitTestRunner/WorkQueueManager.cpp:
(WTR::WorkQueueManager::queueLoad):
* WebKitTestRunner/WorkQueueManager.h:

LayoutTests:

* loader/navigation-policy/resources/notify-done.html: Added.
* loader/navigation-policy/should-load-external-urls-set-by-api-basic-expected.txt: Added.
* loader/navigation-policy/should-load-external-urls-set-by-api-basic.html: Added.
* loader/navigation-policy/should-not-load-external-urls-set-by-api-basic-expected.txt: Added.
* loader/navigation-policy/should-not-load-external-urls-set-by-api-basic.html: Added.

* platform/ios-simulator-wk1/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
27 files changed:
LayoutTests/ChangeLog
LayoutTests/loader/navigation-policy/should-open-external-urls/api-does-not-set-flag-basic-expected.txt [new file with mode: 0644]
LayoutTests/loader/navigation-policy/should-open-external-urls/api-does-not-set-flag-basic.html [new file with mode: 0644]
LayoutTests/loader/navigation-policy/should-open-external-urls/api-sets-flag-basic-expected.txt [new file with mode: 0644]
LayoutTests/loader/navigation-policy/should-open-external-urls/api-sets-flag-basic.html [new file with mode: 0644]
LayoutTests/loader/navigation-policy/should-open-external-urls/resources/notify-done.html [new file with mode: 0644]
LayoutTests/platform/ios-simulator-wk1/TestExpectations
LayoutTests/platform/mac-wk1/TestExpectations
LayoutTests/platform/win/TestExpectations
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/API/C/WKPagePrivate.h
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNavigationActionPrivate.h [new file with mode: 0644]
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.h
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
Tools/WebKitTestRunner/TestInvocation.cpp
Tools/WebKitTestRunner/WorkQueueManager.cpp
Tools/WebKitTestRunner/WorkQueueManager.h