From feafb3184d32c32e6d24fdf1e7b2907ed73886fe Mon Sep 17 00:00:00 2001 From: "commit-queue@webkit.org" Date: Mon, 21 May 2012 20:48:22 +0000 Subject: [PATCH] [Qt][WK2] REGRESSION, fix a failing API test in qmltests https://bugs.webkit.org/show_bug.cgi?id=82700 Patch by Marcelo Lira on 2012-05-21 Reviewed by Alexis Menard. The value of a CSS font-family property is expected to have single quotes when white space is present in its name, and no quotes otherwise. Font family names returned by WebView.experimental.preferences never add quotes. Since what matter to the test is only the identity of the font, an auxiliar method to remove single quotes was added. * UIProcess/API/qt/tests/qmltests/WebView/tst_preferences.qml: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117812 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebKit2/ChangeLog | 16 ++++++++++++++++ .../API/qt/tests/qmltests/WebView/tst_preferences.qml | 6 +++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog index 35fd1eb..9819294 100644 --- a/Source/WebKit2/ChangeLog +++ b/Source/WebKit2/ChangeLog @@ -1,3 +1,19 @@ +2012-05-21 Marcelo Lira + + [Qt][WK2] REGRESSION, fix a failing API test in qmltests + https://bugs.webkit.org/show_bug.cgi?id=82700 + + Reviewed by Alexis Menard. + + The value of a CSS font-family property is expected to have single + quotes when white space is present in its name, and no quotes otherwise. + Font family names returned by WebView.experimental.preferences never add quotes. + + Since what matter to the test is only the identity of the font, an auxiliar + method to remove single quotes was added. + + * UIProcess/API/qt/tests/qmltests/WebView/tst_preferences.qml: + 2012-05-21 Allan Sandfeld Jensen GCC 4.7 and C++11 diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_preferences.qml b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_preferences.qml index 16ff35c..71fa3eb 100644 --- a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_preferences.qml +++ b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_preferences.qml @@ -195,6 +195,10 @@ Item { compare(webView2.title, "New Title") } + function unquote(text) { + return text[0] === "'" ? text.slice(1, -1) : text + } + function test_standardFontFamilyChanged() { var url = Qt.resolvedUrl("../common/font-preferences.html?standard#font-family") webView.url = url @@ -203,7 +207,7 @@ Item { titleSpy.clear() titleSpy.wait() - compare(webView.title, defaultStandardFontFamily) + compare(unquote(webView.title), defaultStandardFontFamily) webView.experimental.preferences.standardFontFamily = "foobar" standardFontFamilySpy.wait() -- 2.7.4