Diff
Modified: trunk/Source/WebKit/ChangeLog (251128 => 251129)
--- trunk/Source/WebKit/ChangeLog 2019-10-15 10:12:11 UTC (rev 251128)
+++ trunk/Source/WebKit/ChangeLog 2019-10-15 10:37:14 UTC (rev 251129)
@@ -1,5 +1,12 @@
2019-10-15 Carlos Garcia Campos <cgar...@igalia.com>
+ Unreviewed. Fix GTK test /webkit/Authentication/authentication-storage after r249962
+
+ * UIProcess/API/glib/WebKitWebView.cpp:
+ (webkitWebViewHandleAuthenticationChallenge): Do not use webkit_settings_get_enable_private_browsing().
+
+2019-10-15 Carlos Garcia Campos <cgar...@igalia.com>
+
Unreviewed. Fix GTK test /webkit/WebKitSettings/webkit-settings after r249962.
Legacy private browsing was removed in r249962, so webkit_settings_set_enable_private_browsing() is now no-op.
Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp (251128 => 251129)
--- trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp 2019-10-15 10:12:11 UTC (rev 251128)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp 2019-10-15 10:37:14 UTC (rev 251129)
@@ -2515,14 +2515,7 @@
void webkitWebViewHandleAuthenticationChallenge(WebKitWebView* webView, AuthenticationChallengeProxy* authenticationChallenge)
{
-#if PLATFORM(GTK)
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
- gboolean privateBrowsingEnabled = webView->priv->isEphemeral || webkit_settings_get_enable_private_browsing(webView->priv->settings.get());
- G_GNUC_END_IGNORE_DEPRECATIONS;
-#else
- gboolean privateBrowsingEnabled = webView->priv->isEphemeral;
-#endif
- webView->priv->authenticationRequest = adoptGRef(webkitAuthenticationRequestCreate(authenticationChallenge, privateBrowsingEnabled));
+ webView->priv->authenticationRequest = adoptGRef(webkitAuthenticationRequestCreate(authenticationChallenge, webView->priv->isEphemeral));
gboolean returnValue;
g_signal_emit(webView, signals[AUTHENTICATE], 0, webView->priv->authenticationRequest.get(), &returnValue);
}
Modified: trunk/Tools/ChangeLog (251128 => 251129)
--- trunk/Tools/ChangeLog 2019-10-15 10:12:11 UTC (rev 251128)
+++ trunk/Tools/ChangeLog 2019-10-15 10:37:14 UTC (rev 251129)
@@ -1,5 +1,22 @@
2019-10-15 Carlos Garcia Campos <cgar...@igalia.com>
+ Unreviewed. Fix GTK test /webkit/Authentication/authentication-storage after r249962
+
+ The test was still using the legacy private browsing API that is a no-op since r249962. This partch updates the
+ test to use a ephemeral WebView instead.
+
+ * TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp:
+ (EphemeralAuthenticationTest::setup):
+ (EphemeralAuthenticationTest::teardown):
+ (testWebViewAuthenticationEphemeral):
+ (testWebViewAuthenticationStorage):
+ (beforeAll):
+ * TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp:
+ (WebViewTest::initializeWebView):
+ * TestWebKitAPI/glib/WebKitGLib/WebViewTest.h:
+
+2019-10-15 Carlos Garcia Campos <cgar...@igalia.com>
+
Unreviewed. Fix GTK test /webkit/WebKitSettings/webkit-settings after r249962.
Stop testing WebKitSettings:enable-private-browsing.
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp (251128 => 251129)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp 2019-10-15 10:12:11 UTC (rev 251128)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp 2019-10-15 10:37:14 UTC (rev 251129)
@@ -78,6 +78,21 @@
GRefPtr<WebKitAuthenticationRequest> m_authenticationRequest;
};
+class EphemeralAuthenticationTest : public AuthenticationTest {
+public:
+ MAKE_GLIB_TEST_FIXTURE_WITH_SETUP_TEARDOWN(EphemeralAuthenticationTest, setup, teardown);
+
+ static void setup()
+ {
+ WebViewTest::shouldCreateEphemeralWebView = true;
+ }
+
+ static void teardown()
+ {
+ WebViewTest::shouldCreateEphemeralWebView = false;
+ }
+};
+
int AuthenticationTest::authenticationRetries = 0;
bool AuthenticationTest::authenticationCancelledReceived = false;
@@ -184,30 +199,23 @@
g_assert_cmpstr(webkit_web_view_get_title(test->m_webView), ==, authExpectedFailureTitle);
}
-// FIXME: Find a way to not use the private browsing setting and enable for WPE.
-#if PLATFORM(GTK)
-static void testWebViewAuthenticationStorage(AuthenticationTest* test, gconstpointer)
+static void testWebViewAuthenticationEphemeral(EphemeralAuthenticationTest* test, gconstpointer)
{
- // Enable private browsing before authentication request to test that credentials can't be saved.
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
- webkit_settings_set_enable_private_browsing(webkit_web_view_get_settings(test->m_webView), TRUE);
- G_GNUC_END_IGNORE_DEPRECATIONS;
test->loadURI(kServer->getURIForPath("/auth-test.html").data());
- WebKitAuthenticationRequest* request = test->waitForAuthenticationRequest();
+ auto* request = test->waitForAuthenticationRequest();
g_assert_null(webkit_authentication_request_get_proposed_credential(request));
g_assert_false(webkit_authentication_request_can_save_credentials(request));
+}
+#if USE(LIBSECRET)
+static void testWebViewAuthenticationStorage(AuthenticationTest* test, gconstpointer)
+{
// If WebKit has been compiled with libsecret, and private browsing is disabled
// then check that credentials can be saved.
-#if USE(LIBSECRET)
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
- webkit_settings_set_enable_private_browsing(webkit_web_view_get_settings(test->m_webView), FALSE);
- G_GNUC_END_IGNORE_DEPRECATIONS;
test->loadURI(kServer->getURIForPath("/auth-test.html").data());
- request = test->waitForAuthenticationRequest();
+ auto* request = test->waitForAuthenticationRequest();
g_assert_null(webkit_authentication_request_get_proposed_credential(request));
g_assert_true(webkit_authentication_request_can_save_credentials(request));
-#endif
}
#endif
@@ -420,7 +428,8 @@
AuthenticationTest::add("Authentication", "authentication-success", testWebViewAuthenticationSuccess);
AuthenticationTest::add("Authentication", "authentication-failure", testWebViewAuthenticationFailure);
AuthenticationTest::add("Authentication", "authentication-no-credential", testWebViewAuthenticationNoCredential);
-#if PLATFORM(GTK)
+ EphemeralAuthenticationTest::add("Authentication", "authentication-ephemeral", testWebViewAuthenticationEphemeral);
+#if USE(LIBSECRET)
AuthenticationTest::add("Authentication", "authentication-storage", testWebViewAuthenticationStorage);
#endif
AuthenticationTest::add("Authentication", "authentication-empty-realm", testWebViewAuthenticationEmptyRealm);
Modified: trunk/Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp (251128 => 251129)
--- trunk/Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp 2019-10-15 10:12:11 UTC (rev 251128)
+++ trunk/Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp 2019-10-15 10:37:14 UTC (rev 251129)
@@ -24,6 +24,7 @@
#include <_javascript_Core/JSRetainPtr.h>
bool WebViewTest::shouldInitializeWebViewInConstructor = true;
+bool WebViewTest::shouldCreateEphemeralWebView = false;
WebViewTest::WebViewTest()
: m_userContentManager(adoptGRef(webkit_user_content_manager_new()))
@@ -56,6 +57,7 @@
#endif
"web-context", m_webContext.get(),
"user-content-manager", m_userContentManager.get(),
+ "is-ephemeral", shouldCreateEphemeralWebView,
nullptr));
platformInitializeWebView();
assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_webView));
Modified: trunk/Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.h (251128 => 251129)
--- trunk/Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.h 2019-10-15 10:12:11 UTC (rev 251128)
+++ trunk/Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.h 2019-10-15 10:37:14 UTC (rev 251129)
@@ -30,6 +30,7 @@
virtual ~WebViewTest();
static bool shouldInitializeWebViewInConstructor;
+ static bool shouldCreateEphemeralWebView;
void initializeWebView();
void platformInitializeWebView();