2010-11-24 Kristian Amlie <kristian.amlie@nokia.com>
[WebKit.git] / WebKit / qt / tests / qwebpage / tst_qwebpage.cpp
index 27a36c3320bcc0add6deaf157ae399a38f62980c..c27ba022ab4e3ddae8626eae694c9fcdb39bb9e6 100644 (file)
@@ -1568,6 +1568,20 @@ void tst_QWebPage::inputMethods()
     page->event(&evpres);
     page->event(&evrel);
 
+    {
+        QList<QInputMethodEvent::Attribute> attributes;
+        QInputMethodEvent event(QString(), attributes);
+        event.setCommitString("XXX", 0, 0);
+        page->event(&event);
+        event.setCommitString(QString(), -2, 2); // Erase two characters.
+        page->event(&event);
+        event.setCommitString(QString(), -1, 1); // Erase one character.
+        page->event(&event);
+        variant = page->inputMethodQuery(Qt::ImSurroundingText);
+        value = variant.value<QString>();
+        QCOMPARE(value, QString("QtWebKit"));
+    }
+
     //Move to the start of the line
     page->triggerAction(QWebPage::MoveToStartOfLine);