Changeset 53847 in webkit
- Timestamp:
- Jan 26, 2010 2:40:58 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r53846 r53847 1 2010-01-26 Holger Hans Peter Freyther <zecke@selfish.org> 2 3 Reviewed by Simon Hausmann. 4 5 [Qt] JavaScript prompt is currently broken. 6 https://bugs.webkit.org/show_bug.cgi?id=30914 7 8 Remove the manual test case in favor of an automated 9 test case in WebKit/qt/tests/qwebpage. 10 11 * manual-tests/qt/java-script-prompt.html: Removed. 12 1 13 2010-01-26 Pavel Feldman <pfeldman@chromium.org> 2 14 -
trunk/WebKit/qt/ChangeLog
r53802 r53847 1 2010-01-26 Holger Hans Peter Freyther <zecke@selfish.org> 2 3 Reviewed by Simon Hausmann. 4 5 [Qt] JavaScript prompt is currently broken 6 https://bugs.webkit.org/show_bug.cgi?id=30914 7 8 In r52152 a patch was landed to convert a null QString 9 to an empty WebCore::String in case the prompt was accepted 10 but the default implementation returned the null QString. 11 12 The patch tried to avoid assign to result twice and 13 was not checking the QString if it is null but the default 14 value. This lead to always returning an empty string on 15 successful prompts. Fix it by checking the variable 'x' 16 for isNull. 17 18 The manual test case used didn't cover the case of non 19 empty input, replace it with an automatic test case that 20 should cover all cases. 21 22 * WebCoreSupport/ChromeClientQt.cpp: 23 (WebCore::ChromeClientQt::runJavaScriptPrompt): Fix the bug. 24 * tests/qwebpage/tst_qwebpage.cpp: Add automatic test case 25 (JSPromptPage::JSPromptPage): 26 (JSPromptPage::javaScriptPrompt): 27 (tst_QWebPage::testJSPrompt): 28 1 29 2010-01-25 Simon Hausmann <hausmann@webkit.org> 2 30 -
trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
r53618 r53847 292 292 // Fix up a quirk in the QInputDialog class. If no input happened the string should be empty 293 293 // but it is null. See https://bugs.webkit.org/show_bug.cgi?id=30914. 294 if (rc && result.isNull())294 if (rc && x.isNull()) 295 295 result = String(""); 296 296 else -
trunk/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
r53614 r53847 2 2 Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 3 Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in> 4 Copyright (C) 2010 Holger Hans Peter Freyther 4 5 5 6 This library is free software; you can redistribute it and/or … … 109 110 110 111 void originatingObjectInNetworkRequests(); 112 void testJSPrompt(); 111 113 112 114 private: … … 1760 1762 } 1761 1763 1764 /** 1765 * Test fixups for https://bugs.webkit.org/show_bug.cgi?id=30914 1766 * 1767 * From JS we test the following conditions. 1768 * 1769 * OK + QString() => SUCCESS, empty string (but not null) 1770 * OK + "text" => SUCCESS, "text" 1771 * CANCEL + QString() => CANCEL, null string 1772 * CANCEL + "text" => CANCEL, null string 1773 */ 1774 class JSPromptPage : public QWebPage { 1775 Q_OBJECT 1776 public: 1777 JSPromptPage() 1778 {} 1779 1780 bool javaScriptPrompt(QWebFrame* frame, const QString& msg, const QString& defaultValue, QString* result) 1781 { 1782 if (msg == QLatin1String("test1")) { 1783 *result = QString(); 1784 return true; 1785 } else if (msg == QLatin1String("test2")) { 1786 *result = QLatin1String("text"); 1787 return true; 1788 } else if (msg == QLatin1String("test3")) { 1789 *result = QString(); 1790 return false; 1791 } else if (msg == QLatin1String("test4")) { 1792 *result = QLatin1String("text"); 1793 return false; 1794 } 1795 1796 qFatal("Unknown msg."); 1797 return QWebPage::javaScriptPrompt(frame, msg, defaultValue, result); 1798 } 1799 }; 1800 1801 void tst_QWebPage::testJSPrompt() 1802 { 1803 JSPromptPage page; 1804 bool res; 1805 1806 // OK + QString() 1807 res = page.mainFrame()->evaluateJavaScript( 1808 "var retval = prompt('test1');" 1809 "retval=='' && retval.length == 0;").toBool(); 1810 QVERIFY(res); 1811 1812 // OK + "text" 1813 res = page.mainFrame()->evaluateJavaScript( 1814 "var retval = prompt('test2');" 1815 "retval=='text' && retval.length == 4;").toBool(); 1816 QVERIFY(res); 1817 1818 // Cancel + QString() 1819 res = page.mainFrame()->evaluateJavaScript( 1820 "var retval = prompt('test3');" 1821 "retval===null;").toBool(); 1822 QVERIFY(res); 1823 1824 // Cancel + "text" 1825 res = page.mainFrame()->evaluateJavaScript( 1826 "var retval = prompt('test4');" 1827 "retval===null;").toBool(); 1828 QVERIFY(res); 1829 } 1830 1762 1831 QTEST_MAIN(tst_QWebPage) 1763 1832 #include "tst_qwebpage.moc"
Note: See TracChangeset
for help on using the changeset viewer.