~zsombi/ubuntu-ui-toolkit/listitemSelectModeBugs

« back to all changes in this revision

Viewing changes to tests/unit_x11/tst_components/tst_textinput_common13.qml

  • Committer: Zsombor Egri
  • Date: 2015-11-20 16:37:59 UTC
  • mfrom: (1662.2.62 staging)
  • Revision ID: zsombor.egri@canonical.com-20151120163759-8p94jar0o53nbu95
staging sync

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
        TextField {
97
97
            id: textField
98
98
        }
 
99
 
 
100
        TextField {
 
101
            id: customTextField
 
102
            text: 'Lorem ipsum dolor sit amet'
 
103
            primaryItem: AbstractButton {
 
104
                id: primaryButton
 
105
                height: parent.height
 
106
                width: height
 
107
                Image {
 
108
                    anchors.fill: parent
 
109
                    anchors.margins: units.gu(0.5)
 
110
                    source: 'image://theme/torch-on'
 
111
                }
 
112
            }
 
113
            secondaryItem: AbstractButton {
 
114
                id: secondaryButton
 
115
                height: parent.height
 
116
                width: height
 
117
                Image {
 
118
                    anchors.fill: parent
 
119
                    anchors.margins: units.gu(0.5)
 
120
                    source: 'image://theme/settings'
 
121
                }
 
122
            }
 
123
        }
99
124
        TextArea {
100
125
            id: textArea
101
126
        }
443
468
            else
444
469
                verify(popoverY >= 0, 'Popover went off-screen: %1'.arg(popoverY));
445
470
        }
 
471
 
 
472
        function test_secondaryItem_must_not_grab_focus() {
 
473
            var textField = customTextField;
 
474
            textField.forceActiveFocus();
 
475
            compare(textField.focus, true, 'TextField is focused');
 
476
 
 
477
            var clearButton = findChild(textField, "clear_button")
 
478
            mouseClick(clearButton, clearButton.width/2, clearButton.height/2);
 
479
            compare(textField.focus, true, 'TextField remains focused');
 
480
            mouseClick(primaryButton, primaryButton.width/2, primaryButton.height/2);
 
481
            compare(textField.focus, true, 'TextField remains focused');
 
482
            mouseClick(secondaryButton, secondaryButton.width/2, secondaryButton.height/2);
 
483
            compare(textField.focus, true, 'TextField remains focused');
 
484
        }
446
485
    }
447
486
}