Updated icon.png and config.xml for all widget related file in WRT TCs
[test/tct/web/wrt.git] / tct-rt02-wrt-tests / lifecycle-resume-javascript / index.html
1 <!DOCTYPE html>
2 <!--
3 Copyright (c) 2012 Intel Corporation.
4
5 Redistribution and use in source and binary forms, with or without modification,
6 are permitted provided that the following conditions are met:
7
8 * Redistributions of works must retain the original copyright notice, this list
9   of conditions and the following disclaimer.
10 * Redistributions in binary form must reproduce the original copyright notice,
11   this list of conditions and the following disclaimer in the documentation
12   and/or other materials provided with the distribution.
13 * Neither the name of Intel Corporation nor the names of its contributors
14   may be used to endorse or promote products derived from this work without
15   specific prior written permission.
16
17 THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
18 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
21 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28 Authors:
29         Hao, Yunfei <yunfenx.hao@intel.com>
30
31 -->
32
33 <html>
34   <head>
35     <title>WRT Test: lifecycle-resume-javascript</title>
36     <link rel="author" title="Intel" href="http://www.intel.com"/>
37     <link rel="help" href=""/>
38     <meta name="flags" content=""/>
39     <meta name="assert" content="Check if WRT is able to resume JavaScript execution and rendering when Web Application enters visible state."/>
40     <meta charset="utf-8">
41     <script language="javascript" type="text/javascript">
42         var systime = new Date();
43         var timer = systime.getTime();
44         var timer2 = systime.getHours()+":"+systime.getMinutes()+":"+systime.getSeconds();
45         // Time interval
46         var t = 1000;
47         //define the divID
48         var ctl_id = "show";
49         var timer_id = "timer_id";
50         var in_time = "in_time";
51         //Counter of js
52         var Num = 0;
53
54         onload = function() {
55             Refresh();
56             setInterval("Refresh();", t);
57             //The time when entry this page timer2
58             document.getElementById(in_time).innerHTML = timer2;
59         }
60         function Refresh() {
61             Num = Num + 1;
62             //The true timer: NowTime - entryTime
63             document.getElementById(timer_id).innerHTML = Math.floor((new Date().getTime()-timer+1000)/1000);
64             //The timer of js
65             document.getElementById(ctl_id).innerHTML = Num;
66             check();
67         }
68         function check(){
69             if(document.getElementById(timer_id).innerHTML!=document.getElementById(ctl_id).innerHTML){
70                 document.getElementById("result").innerHTML = "<p style='color:green'>Pass</p>";
71             }
72             else{
73                 document.getElementById("result").innerHTML = "<p style='color:red'>Fail</p>";
74             }
75         }
76     </script>
77   </head>
78   <body>
79     Entry time:<div id="in_time"></div>
80     system timer:<div id="timer_id"></div>
81     js timer:<div id="show"></div>
82     <div>-------------------</div>
83     <div>Result:</div>
84     <div id = "result"></div>
85   </body>
86 </html>