tst_controls: use TestCase::createTemporaryObject()

Change-Id: Iec2e4fdba18402762c6d6580abf8e677d5ae583c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This commit is contained in:
J-P Nurmi 2017-05-09 08:56:50 +02:00
parent 28063805bf
commit 3cf7160277
4 changed files with 6 additions and 16 deletions

View File

@ -147,7 +147,7 @@ TestCase {
}
function test_keyEvents(data) {
var container = keyCatcher.createObject(testCase)
var container = createTemporaryObject(keyCatcher, testCase)
verify(container)
var control = button.createObject(container)
@ -161,7 +161,5 @@ TestCase {
keyRelease(data.key)
compare(container.lastKeyRelease, data.result)
container.destroy()
}
}

View File

@ -152,15 +152,13 @@ TestCase {
}
function test_implicitContentItem() {
var control = pane.createObject(testCase, {width: 100, height: 100})
var control = createTemporaryObject(pane, testCase, {width: 100, height: 100})
verify(control)
compare(control.width, 100)
compare(control.height, 100)
compare(control.contentItem.width, control.availableWidth)
compare(control.contentItem.height, control.availableHeight)
control.destroy()
}
function test_press() {

View File

@ -197,7 +197,7 @@ TestCase {
}
function test_availableSize() {
var control = popupTemplate.createObject(testCase)
var control = createTemporaryObject(popupTemplate, testCase)
verify(control)
var availableWidthSpy = createTemporaryObject(signalSpy, testCase, {target: control, signalName: "availableWidthChanged"})
@ -1247,12 +1247,10 @@ TestCase {
}
function test_windowParent() {
var control = popupControl.createObject(applicationWindow, {width: 100, height: 100})
var control = createTemporaryObject(popupControl, applicationWindow, {width: 100, height: 100})
verify(control)
control.open()
verify(control.visible)
control.destroy()
}
}

View File

@ -1022,7 +1022,7 @@ TestCase {
}
function test_pushSameItem() {
var control = stackView.createObject(testCase)
var control = createTemporaryObject(stackView, testCase)
verify(control)
control.push(item, StackView.Immediate)
@ -1045,12 +1045,10 @@ TestCase {
verify(current !== item)
compare(control.currentItem, current)
compare(control.depth, 3)
control.destroy()
}
function test_visible() {
var control = stackView.createObject(testCase)
var control = createTemporaryObject(stackView, testCase)
verify(control)
var item1 = component.createObject(control)
@ -1098,8 +1096,6 @@ TestCase {
control.pop(StackView.Immediate)
compare(item1.visible, true)
compare(item1.StackView.visible, true)
control.destroy()
}
function test_resolve() {