Modified: trunk/Tools/ChangeLog (221415 => 221416)
--- trunk/Tools/ChangeLog 2017-08-31 04:07:34 UTC (rev 221415)
+++ trunk/Tools/ChangeLog 2017-08-31 08:15:54 UTC (rev 221416)
@@ -1,3 +1,12 @@
+2017-08-31 Carlos Garcia Campos <[email protected]>
+
+ Unreviewed. Fix GTK+ test /webkit2/WebKitAutomationSession/request-session.
+
+ It fails when comparing the browser version if micro version is 0 (or if both micro and minor are 0 too).
+
+ * TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp: Use a helper method to convert major, minor, micro
+ numbers into a version string, using the same approach as WebKitAutomationSession.
+
2017-08-30 Dan Bernstein <[email protected]>
[iOS] REGRESSION (r218144) -[WKContentView targetForAction:withSender:] returns the content view for actions implemented only by the WKWebView, causing a crash
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp (221415 => 221416)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp 2017-08-31 04:07:34 UTC (rev 221415)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp 2017-08-31 08:15:54 UTC (rev 221416)
@@ -193,6 +193,17 @@
test->automationStarted(session);
}
+ static GUniquePtr<char> toVersionString(unsigned major, unsigned minor, unsigned micro)
+ {
+ if (!micro && !minor)
+ return GUniquePtr<char>(g_strdup_printf("%u", major));
+
+ if (!micro)
+ return GUniquePtr<char>(g_strdup_printf("%u.%u", major, minor));
+
+ return GUniquePtr<char>(g_strdup_printf("%u.%u.%u", major, minor, micro));
+ }
+
WebKitAutomationSession* requestSession(const char* sessionID)
{
auto signalID = g_signal_connect(m_webContext.get(), "automation-started", G_CALLBACK(automationStartedCallback), this);
@@ -209,7 +220,7 @@
const char* browserVersion;
g_variant_get(capabilities.get(), "(&s&s)", &browserName, &browserVersion);
g_assert_cmpstr(browserName, ==, "AutomationTestBrowser");
- GUniquePtr<char> versionString(g_strdup_printf("%u.%u.%u", WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION, WEBKIT_MICRO_VERSION));
+ GUniquePtr<char> versionString = toVersionString(WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION, WEBKIT_MICRO_VERSION);
g_assert_cmpstr(browserVersion, ==, versionString.get());
}, this
);