summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@digia.com>2014-01-22 09:39:04 +0100
committerChristian Stenger <christian.stenger@digia.com>2014-01-23 11:05:09 +0100
commit1cdb5d87c2bb46d21d3da37863f40d2232dfd90c (patch)
tree0883a7831f266cded2255b5e7bd32bcaa2437905
parentc567dabc7164eb75d5617fc827089a421a960e52 (diff)
downloadqt-creator-1cdb5d87c2bb46d21d3da37863f40d2232dfd90c.tar.gz
Squish: Update Qt Quick hooking stuff...
...to differentiate between Qt Quick 1 and Qt Quick 2 when using no additional function on the subprocess. Change-Id: Ia345a1503128be0c5b81a010c438009bf41d93b5 Reviewed-by: Robert Loehning <robert.loehning@digia.com>
-rw-r--r--tests/system/shared/classes.py9
-rw-r--r--tests/system/shared/project.py14
-rw-r--r--tests/system/suite_qtquick/tst_qtquick_creation/test.py2
-rw-r--r--tests/system/suite_qtquick/tst_qtquick_creation3/test.py2
4 files changed, 15 insertions, 12 deletions
diff --git a/tests/system/shared/classes.py b/tests/system/shared/classes.py
index 5a7e84bbf0..b1f86d9f88 100644
--- a/tests/system/shared/classes.py
+++ b/tests/system/shared/classes.py
@@ -136,13 +136,16 @@ class SubprocessType:
USER_DEFINED=3
@staticmethod
- def getWindowType(subprocessType):
+ def getWindowType(subprocessType, qtQuickVersion=1):
if subprocessType == SubprocessType.QT_WIDGET:
return "QMainWindow"
if subprocessType == SubprocessType.QT_QUICK_APPLICATION:
- return "QmlApplicationViewer"
+ return "QtQuick%dApplicationViewer" % qtQuickVersion
if subprocessType == SubprocessType.QT_QUICK_UI:
- return "QDeclarativeViewer"
+ if qtQuickVersion == 1:
+ return "QDeclarativeViewer"
+ else:
+ return "QQuickView"
if subprocessType == SubprocessType.USER_DEFINED:
return "user-defined"
test.fatal("Could not determine the WindowType for SubprocessType %s" % subprocessType)
diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py
index 7979e05a2b..379548a121 100644
--- a/tests/system/shared/project.py
+++ b/tests/system/shared/project.py
@@ -397,7 +397,7 @@ def waitForProcessRunning(running=True):
# userDefinedType - if you set sType to SubprocessType.USER_DEFINED you must(!) specify the WindowType for hooking into
# by yourself (or use the function parameter)
# ATTENTION! Make sure this function won't fail and the sub-process will end when the function returns
-def runAndCloseApp(withHookInto=False, executable=None, port=None, function=None, sType=None, userDefinedType=None):
+def runAndCloseApp(withHookInto=False, executable=None, port=None, function=None, sType=None, userDefinedType=None, quickVersion=1):
runButton = waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton")
clickButton(runButton)
if sType != SubprocessType.QT_QUICK_UI:
@@ -414,7 +414,7 @@ def runAndCloseApp(withHookInto=False, executable=None, port=None, function=None
return False
if sType == SubprocessType.QT_QUICK_UI and os.getenv("SYSTEST_QMLVIEWER_NO_HOOK_INTO", "0") == "1":
withHookInto = False
- if withHookInto and not validType(sType, userDefinedType):
+ if withHookInto and not validType(sType, userDefinedType, quickVersion):
if function != None:
test.warning("You did not provide a valid value for the SubprocessType value - sType, but you have "
"provided a function to execute on the subprocess. Please ensure that your function "
@@ -425,15 +425,15 @@ def runAndCloseApp(withHookInto=False, executable=None, port=None, function=None
"inside creator to terminate execution of the subprocess.")
withHookInto = False
if withHookInto and not executable in ("", None):
- __closeSubprocessByHookingInto__(executable, port, function, sType, userDefinedType)
+ __closeSubprocessByHookingInto__(executable, port, function, sType, userDefinedType, quickVersion)
else:
__closeSubprocessByPushingStop__(sType)
return True
-def validType(sType, userDef):
+def validType(sType, userDef, quickVersion):
if sType == None:
return False
- ty = SubprocessType.getWindowType(sType)
+ ty = SubprocessType.getWindowType(sType, quickVersion)
return ty != None and not (ty == "user-defined" and (userDef == None or userDef.strip() == ""))
def __closeSubprocessByPushingStop__(sType):
@@ -455,7 +455,7 @@ def __closeSubprocessByPushingStop__(sType):
else:
test.fatal("Subprocess does not seem to have been started.")
-def __closeSubprocessByHookingInto__(executable, port, function, sType, userDefType):
+def __closeSubprocessByHookingInto__(executable, port, function, sType, userDefType, quickVersion):
ensureChecked(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton")
output = waitForObject("{type='Core::OutputWindow' visible='1' windowTitle='Application Output Window'}")
if port == None:
@@ -498,7 +498,7 @@ def __closeSubprocessByHookingInto__(executable, port, function, sType, userDefT
if sType==SubprocessType.USER_DEFINED:
sendEvent("QCloseEvent", "{type='%s' unnamed='1' visible='1'}" % userDefType)
else:
- sendEvent("QCloseEvent", "{type='%s' unnamed='1' visible='1'}" % SubprocessType.getWindowType(sType))
+ sendEvent("QCloseEvent", "{type='%s' unnamed='1' visible='1'}" % SubprocessType.getWindowType(sType, quickVersion))
resetApplicationContextToCreator()
else:
try:
diff --git a/tests/system/suite_qtquick/tst_qtquick_creation/test.py b/tests/system/suite_qtquick/tst_qtquick_creation/test.py
index 9604148773..46d6d55d01 100644
--- a/tests/system/suite_qtquick/tst_qtquick_creation/test.py
+++ b/tests/system/suite_qtquick/tst_qtquick_creation/test.py
@@ -54,7 +54,7 @@ def main():
if result:
result = runAndCloseApp(True, projectName, 11223,
"subprocessFunctionQuick%d" % qVer,
- SubprocessType.QT_QUICK_APPLICATION)
+ SubprocessType.QT_QUICK_APPLICATION, quickVersion=qVer)
else:
result = runAndCloseApp(sType=SubprocessType.QT_QUICK_APPLICATION)
removeExecutableAsAttachableAUT(projectName, 11223)
diff --git a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py
index 9ef1f8d5c1..44431429f5 100644
--- a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py
+++ b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py
@@ -45,7 +45,7 @@ def main():
result = addExecutableAsAttachableAUT(qmlViewer, 11223)
allowAppThroughWinFW(qmlViewerPath, qmlViewer, None)
if result:
- result = runAndCloseApp(True, qmlViewer, 11223, sType=SubprocessType.QT_QUICK_UI)
+ result = runAndCloseApp(True, qmlViewer, 11223, sType=SubprocessType.QT_QUICK_UI, quickVersion=quickVersion)
else:
result = runAndCloseApp(sType=SubprocessType.QT_QUICK_UI)
removeExecutableAsAttachableAUT(qmlViewer, 11223)