Revert change in QUnit.js and test fix 32/187932/2
authorTomasz Lukawski <t.lukawski@samsung.com>
Wed, 29 Aug 2018 13:09:59 +0000 (15:09 +0200)
committerTomasz Lukawski <t.lukawski@samsung.com>
Wed, 29 Aug 2018 17:21:28 +0000 (19:21 +0200)
- Event DOMContentLoaded is triggering too early. Default listener has been reverted to "load" event.
- modify nondeterministic jqm test

Change-Id: I7e029bc92255ead76ba301d7669da56995ae23ed
Signed-off-by: Tomasz Lukawski <t.lukawski@samsung.com>
mobile/tct-webuifw-tests01/tests/js/core/core/jqm/core.html [changed mode: 0755->0644]
mobile/tct-webuifw-tests01/tests/js/core/core/jqm/init_core.js [changed mode: 0755->0644]
mobile/tct-webuifw-tests01/tests/libs/qunit-1.11.0.js [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index e6eaa67..db5518c
     <script src="../../../../libs/support.js"></script>
     <script src="../../../../libs/jquery.testHelper.js"></script>
     <script src="init_core.js"></script>
+    <script type="text/javascript">
+        var tauConfig = tauConfig || {};
+            tauConfig.autorun = false;
+            tauConfig.pageTransition = "none";
+    </script>
     <script src="../../../../libs/dist/js/tau.js"></script>
 </head>
 <body>
old mode 100755 (executable)
new mode 100644 (file)
index a6707ed..6dca36c
@@ -40,6 +40,7 @@
 
        // NOTE for the following two tests see index html for the binding
        test("mobile.page is available when mobile init is fired", function () {
+               reloadCoreNSandInit();
                ok(mobilePage !== undefined, "$.mobile.page is defined");
        });
 
                });
 
                test("pages without a data-url attribute have it set to their id", function () {
+                       reloadCoreNSandInit();
                        deepEqual($("#foo").jqmData("url"), "#foo", "");
                });
 
                test("pages with a data-url attribute are left with the original value", function () {
+                       reloadCoreNSandInit();
                        deepEqual($("#bar").jqmData("url"), "bak", "");
                });
 
 
                        $("<div />", { "data-role": "page", "id": "autoinit-on" }).prependTo("body");
 
+                       var timeout = setTimeout(function () {
+                               false("Test timeout");
+                               start();
+                       }, 4000);
+
                        $(document).one("mobileinit", function () {
                                $.mobile.autoInitializePage = true;
+
+                               setTimeout(function () {
+                                       clearTimeout(timeout);
+                                       deepEqual($("#autoinit-on.ui-page").length, 1, "");
+
+                                       start();
+                               }, 2000);
                        });
 
                        location.hash = "";
 
                        reloadCoreNSandInit();
-
-                       setTimeout(function () {
-                               deepEqual($("#autoinit-on.ui-page").length, 1, "");
-
-                               start();
-                       }, 2000);
                });
 
 
old mode 100755 (executable)
new mode 100644 (file)
index b5bc892..819558a
@@ -1181,7 +1181,7 @@ QUnit.load = function() {
        }
 };
 
-addEvent( window, "DOMContentLoaded", QUnit.load );
+addEvent( window, "load", QUnit.load );
 
 // `onErrorFnPrev` initialized at top of scope
 // Preserve other handlers