[common][navgationtiming][DPTTIZEN-3136, fix 2 tc issue for M69 upgrade] 19/210419/2
authorzhongyuan <zy123.yuan@samsung.com>
Fri, 19 Jul 2019 03:06:00 +0000 (11:06 +0800)
committerzhongyuan <zy123.yuan@samsung.com>
Tue, 30 Jul 2019 01:55:07 +0000 (09:55 +0800)
Change-Id: Ibb1d2348019b22e74605b6452418cfb91b5d6050

common/tct-navigationtiming-w3c-tests/navigationtiming/Performance_measure.html
common/tct-navigationtiming-w3c-tests/navigationtiming/Performance_measure_with_endMark.html

index 62e17df69cdde37f3268891406adb0a7c5a2e17b..32ecb42623556c0bc8e28167c6f2725fb3d8eab9 100755 (executable)
@@ -45,7 +45,7 @@ test(function () {
     });
 
     retVal = window.performance.measure('measureTask');
-    assert_equals(retVal, undefined, "Return value should be undefined.");
+    assert_equals(typeof(retVal), "object", "Return value should be object.");
     entries = window.performance.getEntriesByType("measure");
     assert_equals(entries.length, 1, "The length of entry list should be 1.");
     assert_greater_than(entries[0].duration, 0, "Duration should be bigger than 0.");
@@ -53,4 +53,4 @@ test(function () {
 
 </script>
 </body>
-</html>
\ No newline at end of file
+</html>
index 3ad197dd7c5fe93c6f4ea5e174b0c18a50fddf5d..21186805b302f17388f741768a02a63c31fc0103 100755 (executable)
@@ -27,6 +27,15 @@ Authors:
 <body>
 <div id="log"></div>
 <script>
+function sleep(numberMillis) {
+    var now = new Date();
+    var exitTime = now.getTime() + numberMillis;
+    while (true) {
+        now = new Date();
+        if (now.getTime() > exitTime)
+        return;
+    }
+}
 //==== TEST: Performance_measure_with_endMark
 //==== LABEL Check if measure() method correctly stores the duration between two marks.
 //==== SPEC Tizen Web API:Performance:NavigationTiming:Performance:measure M
@@ -46,9 +55,10 @@ test(function () {
     });
 
     window.performance.mark('markStartTask');
+    sleep(10);
     window.performance.mark('markEndTask');
     retVal = window.performance.measure('measureTask', 'markStartTask', 'markEndTask');
-    assert_equals(retVal, undefined, "Return value should be undefined.");
+    assert_equals(typeof(retVal), "object", "Return value should be object.");
     entries = window.performance.getEntriesByType("measure");
     assert_equals(entries.length, 1, "The length of entry list should be 1.");
     assert_greater_than(entries[0].duration, 0, "Duration should be bigger than 0.");
@@ -56,4 +66,4 @@ test(function () {
 
 </script>
 </body>
-</html>
\ No newline at end of file
+</html>