src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
changeset 19 fcece45ef507
parent 18 2f34d5167611
child 30 5dc02b23752f
equal deleted inserted replaced
18:2f34d5167611 19:fcece45ef507
  1449 
  1449 
  1450     //ImCurrentSelection
  1450     //ImCurrentSelection
  1451     variant = page->inputMethodQuery(Qt::ImCurrentSelection);
  1451     variant = page->inputMethodQuery(Qt::ImCurrentSelection);
  1452     QString selectionValue = variant.value<QString>();
  1452     QString selectionValue = variant.value<QString>();
  1453     QCOMPARE(selectionValue, QString("eb"));
  1453     QCOMPARE(selectionValue, QString("eb"));
       
  1454 
       
  1455     //Set selection with negative length
       
  1456     inputAttributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 6, -5, QVariant());
       
  1457     QInputMethodEvent eventSelection2("",inputAttributes);
       
  1458     page->event(&eventSelection2);
       
  1459 
       
  1460     //ImAnchorPosition
       
  1461     variant = page->inputMethodQuery(Qt::ImAnchorPosition);
       
  1462     anchorPosition =  variant.toInt();
       
  1463     QCOMPARE(anchorPosition, 1);
       
  1464 
       
  1465     //ImCursorPosition
       
  1466     variant = page->inputMethodQuery(Qt::ImCursorPosition);
       
  1467     cursorPosition =  variant.toInt();
       
  1468     QCOMPARE(cursorPosition, 6);
       
  1469 
       
  1470     //ImCurrentSelection
       
  1471     variant = page->inputMethodQuery(Qt::ImCurrentSelection);
       
  1472     selectionValue = variant.value<QString>();
       
  1473     QCOMPARE(selectionValue, QString("tWebK"));
  1454 #endif
  1474 #endif
  1455 
  1475 
  1456     //ImSurroundingText
  1476     //ImSurroundingText
  1457     variant = page->inputMethodQuery(Qt::ImSurroundingText);
  1477     variant = page->inputMethodQuery(Qt::ImSurroundingText);
  1458     QString value = variant.value<QString>();
  1478     QString value = variant.value<QString>();