Commit a8a14072 authored by Robert Loehning's avatar Robert Loehning
Browse files

Squish: Replaced signal handler in tst_CSUP04



Change-Id: Ia24fc657b7033fd383ede2df243bbd29b44c460a
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent 5e428569
...@@ -32,7 +32,6 @@ source("../../shared/qtcreator.py") ...@@ -32,7 +32,6 @@ source("../../shared/qtcreator.py")
# entry of test # entry of test
def main(): def main():
global searchFinished
# prepare example project # prepare example project
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/animation/basics/property-animation") sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/animation/basics/property-animation")
proFile = "propertyanimation.pro" proFile = "propertyanimation.pro"
...@@ -46,7 +45,6 @@ def main(): ...@@ -46,7 +45,6 @@ def main():
return return
# open example project # open example project
openQmakeProject(examplePath) openQmakeProject(examplePath)
installLazySignalHandler("{type='Core::FutureProgress' unnamed='1'}", "finished()", "__handleFutureProgress__")
# wait for parsing to complete # wait for parsing to complete
progressBarWait(30000) progressBarWait(30000)
# open .cpp file in editor # open .cpp file in editor
...@@ -58,13 +56,12 @@ def main(): ...@@ -58,13 +56,12 @@ def main():
"Verifying if: .cpp file is opened in Edit mode.") "Verifying if: .cpp file is opened in Edit mode.")
# place cursor on line "QmlApplicationViewer viewer;" # place cursor on line "QmlApplicationViewer viewer;"
editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
searchFinished = False
# invoke find usages from context menu on word "viewer" # invoke find usages from context menu on word "viewer"
if not invokeFindUsage(editorWidget, "QmlApplicationViewer viewer;", "<Left>", 10): if not invokeFindUsage(editorWidget, "QmlApplicationViewer viewer;", "<Left>", 10):
invokeMenuItem("File", "Exit") invokeMenuItem("File", "Exit")
return return
# wait until search finished and verify search results # wait until search finished and verify search results
waitFor("searchFinished", 20000) waitForSearchResults()
validateSearchResult(14) validateSearchResult(14)
result = re.search("QmlApplicationViewer", str(editorWidget.plainText)) result = re.search("QmlApplicationViewer", str(editorWidget.plainText))
test.verify(result, "Verifying if: The list of all usages of the selected text is displayed in Search Results. " test.verify(result, "Verifying if: The list of all usages of the selected text is displayed in Search Results. "
...@@ -75,17 +72,24 @@ def main(): ...@@ -75,17 +72,24 @@ def main():
return return
for i in range(4): for i in range(4):
type(editorWidget, "<Left>") type(editorWidget, "<Left>")
searchFinished = False
type(editorWidget, "<Ctrl+Shift+U>") type(editorWidget, "<Ctrl+Shift+U>")
# wait until search finished and verify search results # wait until search finished and verify search results
waitFor("searchFinished", 20000) waitForSearchResults()
validateSearchResult(3) validateSearchResult(3)
# exit qt creator # exit qt creator
invokeMenuItem("File", "Save All") invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit") invokeMenuItem("File", "Exit")
def __handleFutureProgress__(*args): def waitForSearchResults():
global searchFinished def __noCancelButton__():
if className(args[0]) == "Core::FutureProgress": global passes
searchFinished = True passes += 1
return not object.exists("{text='Cancel' type='QToolButton' unnamed='1' visible='1' "
"window=':Qt Creator_Core::Internal::MainWindow'}")
global passes
passes = 0
waitFor("__noCancelButton__()", 20000)
if passes < 2:
test.warning("Did not have to wait for search results.",
"Either Creator was really quick or the GUI was changed.")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment