[Qt][WK2] Use Component.onCompleted in API tests for single and multi file upload...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Jun 2012 05:32:27 +0000 (05:32 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Jun 2012 05:32:27 +0000 (05:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=88247

Patch by Dinu Jacob <dinu.jacob@nokia.com> on 2012-06-05
Reviewed by Kenneth Rohde Christiansen.

With r116936, Component.onCompleted can be used for callback instead of the
1s timer in single and multi file upload tests.

* UIProcess/API/qt/tests/qmltests/WebView/tst_multiFileUpload.qml:
* UIProcess/API/qt/tests/qmltests/WebView/tst_singleFileUpload.qml:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@119559 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_multiFileUpload.qml
Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_singleFileUpload.qml

index 206e43e..bcf1f79 100644 (file)
@@ -1,3 +1,16 @@
+2012-06-05  Dinu Jacob  <dinu.jacob@nokia.com>
+
+        [Qt][WK2] Use Component.onCompleted in API tests for single and multi file upload tests.
+        https://bugs.webkit.org/show_bug.cgi?id=88247
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        With r116936, Component.onCompleted can be used for callback instead of the
+        1s timer in single and multi file upload tests.
+
+        * UIProcess/API/qt/tests/qmltests/WebView/tst_multiFileUpload.qml:
+        * UIProcess/API/qt/tests/qmltests/WebView/tst_singleFileUpload.qml:
+
 2012-06-04  Stephanie Lewis  <slewis@apple.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=88370
index 73ea708..15bb0bf 100644 (file)
@@ -13,16 +13,12 @@ TestWebView {
     property bool selectFile
 
     experimental.filePicker: Item {
-        Timer {
-            running: true
-            interval: 1
-            onTriggered: {
-                var selectedFiles = ["filename1", "filename2"]
-                if (selectFile)
-                    model.accept(selectedFiles)
-                else
-                    model.reject();
-            }
+        Component.onCompleted: {
+            var selectedFiles = ["filename1", "filename2"]
+            if (selectFile)
+                model.accept(selectedFiles)
+            else
+                model.reject();
         }
     }
 
index be1409b..6bcd803 100644 (file)
@@ -14,20 +14,16 @@ TestWebView {
     property bool acceptMultiple: false
 
     experimental.filePicker: Item {
-        Timer {
-            running: true
-            interval: 1
-            onTriggered: {
-                var selectedFiles = ["filename1", "filename2"]
-                if (selectFile) {
-                    if (acceptMultiple)
-                        model.accept(selectedFiles)
-                    else
-                        model.accept("acceptedfilename");
-                }
+        Component.onCompleted: {
+            var selectedFiles = ["filename1", "filename2"]
+            if (selectFile) {
+                if (acceptMultiple)
+                    model.accept(selectedFiles)
                 else
-                    model.reject();
+                    model.accept("acceptedfilename");
             }
+            else
+                model.reject();
         }
     }