incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bcur...@apache.org
Subject [1/3] android commit: Tests to verify Android native features.
Date Fri, 30 Mar 2012 16:37:47 GMT
Updated Branches:
  refs/heads/master d2b329636 -> 900be3afe


Tests to verify Android native features.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/900be3af
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/900be3af
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/900be3af

Branch: refs/heads/master
Commit: 900be3afe0d0b73553df9378a8618c9a706663e5
Parents: d2b3296
Author: Bryce Curtis <curtis.bryce@gmail.com>
Authored: Fri Mar 30 11:37:29 2012 -0500
Committer: Bryce Curtis <curtis.bryce@gmail.com>
Committed: Fri Mar 30 11:37:29 2012 -0500

----------------------------------------------------------------------
 test/.classpath                                    |    9 +
 test/.project                                      |   33 +
 test/AndroidManifest.xml                           |   87 +
 test/README.md                                     |   23 +
 test/ant.properties                                |   17 +
 test/assets/www/backbuttonmultipage/index.html     |   23 +
 test/assets/www/backbuttonmultipage/sample2.html   |   23 +
 test/assets/www/backbuttonmultipage/sample3.html   |   26 +
 test/assets/www/background/index.html              |   99 +
 test/assets/www/background/index2.html             |   98 +
 test/assets/www/cordova-1.6.0rc1.js                | 4897 +++++++++++++++
 test/assets/www/cordova.js                         |    2 +
 test/assets/www/htmlnotfound/error.html            |    1 +
 test/assets/www/iframe/index.html                  |   33 +
 test/assets/www/iframe/index2.html                 |   24 +
 test/assets/www/index.html                         |   47 +
 test/assets/www/jqmtabbackbutton/index.html        |   49 +
 test/assets/www/jqmtabbackbutton/tab1.html         |   29 +
 test/assets/www/jqmtabbackbutton/tab2.html         |   30 +
 test/assets/www/jqmtabbackbutton/tab3.html         |   30 +
 test/assets/www/lifecycle/index.html               |  108 +
 test/assets/www/lifecycle/index2.html              |  104 +
 test/assets/www/main.js                            |  150 +
 test/assets/www/master.css                         |  117 +
 test/assets/www/menus/index.html                   |   29 +
 test/assets/www/splashscreen/index.html            |   22 +
 test/assets/www/userwebview/index.html             |   49 +
 test/assets/www/whitelist/index.html               |   29 +
 test/assets/www/whitelist/index2.html              |   23 +
 test/assets/www/xhr/index.html                     |   48 +
 test/build.xml                                     |   85 +
 test/libs/cordova-1.6.0rc1.jar                     |  Bin 0 -> 170594 bytes
 test/project.properties                            |   11 +
 test/res/drawable-hdpi/ic_launcher.png             |  Bin 0 -> 4147 bytes
 test/res/drawable-ldpi/ic_launcher.png             |  Bin 0 -> 1723 bytes
 test/res/drawable-mdpi/ic_launcher.png             |  Bin 0 -> 2574 bytes
 test/res/drawable/icon.png                         |  Bin 0 -> 5800 bytes
 test/res/drawable/sandy.jpg                        |  Bin 0 -> 48450 bytes
 test/res/layout/main.xml                           |   13 +
 test/res/values/strings.xml                        |    4 +
 test/res/xml/cordova.xml                           |    5 +
 test/res/xml/plugins.xml                           |   19 +
 .../org/apache/cordova/test/ActivityPlugin.java    |   81 +
 test/src/org/apache/cordova/test/FixWebView.java   |   43 +
 .../apache/cordova/test/backbuttonmultipage.java   |   30 +
 test/src/org/apache/cordova/test/background.java   |   34 +
 test/src/org/apache/cordova/test/errorurl.java     |   32 +
 test/src/org/apache/cordova/test/htmlnotfound.java |   31 +
 test/src/org/apache/cordova/test/iframe.java       |   30 +
 .../org/apache/cordova/test/jqmtabbackbutton.java  |   30 +
 test/src/org/apache/cordova/test/lifecycle.java    |   30 +
 test/src/org/apache/cordova/test/loading.java      |   31 +
 test/src/org/apache/cordova/test/menus.java        |   80 +
 test/src/org/apache/cordova/test/splashscreen.java |   35 +
 test/src/org/apache/cordova/test/tests.java        |   32 +
 test/src/org/apache/cordova/test/timeout.java      |   34 +
 test/src/org/apache/cordova/test/userwebview.java  |   72 +
 test/src/org/apache/cordova/test/whitelist.java    |   51 +
 test/src/org/apache/cordova/test/xhr.java          |   30 +
 59 files changed, 7102 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/900be3af/test/.classpath
----------------------------------------------------------------------
diff --git a/test/.classpath b/test/.classpath
new file mode 100755
index 0000000..8fb3e5f
--- /dev/null
+++ b/test/.classpath
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="gen"/>
+	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+	<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+	<classpathentry kind="lib" path="libs/cordova-1.6.0rc1.jar"/>
+	<classpathentry kind="output" path="bin/classes"/>
+</classpath>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/900be3af/test/.project
----------------------------------------------------------------------
diff --git a/test/.project b/test/.project
new file mode 100755
index 0000000..d31f9d7
--- /dev/null
+++ b/test/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>CordovaTest</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/900be3af/test/AndroidManifest.xml
----------------------------------------------------------------------
diff --git a/test/AndroidManifest.xml b/test/AndroidManifest.xml
new file mode 100755
index 0000000..b92fc01
--- /dev/null
+++ b/test/AndroidManifest.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:windowSoftInputMode="adjustPan"
+      package="org.apache.cordova.test" android:versionName="1.1" android:versionCode="5">
+    <supports-screens
+    	android:largeScreens="true"
+    	android:normalScreens="true"
+    	android:smallScreens="true"
+    	android:xlargeScreens="true"
+    	android:resizeable="true"
+    	android:anyDensity="true"
+    	/>
+
+    <uses-permission android:name="android.permission.CAMERA" />
+    <uses-permission android:name="android.permission.VIBRATE" />
+    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"
/>
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.RECEIVE_SMS" />
+    <uses-permission android:name="android.permission.RECORD_AUDIO" />
+    <uses-permission android:name="android.permission.RECORD_VIDEO"/>
+    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
+    <uses-permission android:name="android.permission.READ_CONTACTS" />
+    <uses-permission android:name="android.permission.WRITE_CONTACTS" />   
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />  

+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
+    <uses-permission android:name="android.permission.BROADCAST_STICKY" />
+
+    <uses-feature android:name="android.hardware.camera" />
+    <uses-feature android:name="android.hardware.camera.autofocus" />
+
+    <application android:icon="@drawable/icon" android:label="@string/app_name"
+    	android:debuggable="true">
+		<activity android:name="tests" android:label="@string/app_name" 
+				  android:configChanges="orientation|keyboardHidden">
+			<intent-filter>
+				<action android:name="android.intent.action.MAIN" />
+				<category android:name="android.intent.category.LAUNCHER" />
+			</intent-filter>
+        </activity>
+        <activity android:name="splashscreen" android:label="@string/app_name" 
+            	  android:configChanges="orientation|keyboardHidden">
+        </activity>
+        <activity android:name="timeout" android:label="@string/app_name" 
+                  android:configChanges="orientation|keyboardHidden">
+        </activity>
+        <activity android:name="htmlnotfound" android:label="@string/app_name" 
+                  android:configChanges="orientation|keyboardHidden">
+        </activity>
+        <activity android:name="errorurl" android:label="@string/app_name" 
+                  android:configChanges="orientation|keyboardHidden">
+        </activity>
+        <activity android:name="userwebview" android:label="@string/app_name" 
+                  android:configChanges="orientation|keyboardHidden">
+        </activity>
+        <activity android:name="menus" android:label="@string/app_name" 
+                  android:configChanges="orientation|keyboardHidden">
+        </activity>
+        <activity android:name="loading" android:label="@string/app_name" 
+                  android:configChanges="orientation|keyboardHidden">
+        </activity>
+        <activity android:name="lifecycle" android:label="@string/app_name" 
+                  android:configChanges="orientation|keyboardHidden">
+        </activity>
+        <activity android:name="jqmtabbackbutton" android:label="@string/app_name" 
+                  android:configChanges="orientation|keyboardHidden">
+        </activity>
+        <activity android:name="backbuttonmultipage" android:label="@string/app_name"

+                  android:configChanges="orientation|keyboardHidden">
+        </activity>
+        <activity android:name="whitelist" android:label="@string/app_name" 
+                  android:configChanges="orientation|keyboardHidden">
+        </activity>
+        <activity android:name="background" android:label="@string/app_name" 
+                  android:configChanges="orientation|keyboardHidden">
+        </activity>
+        <activity android:name="iframe" android:label="@string/app_name" 
+                  android:configChanges="orientation|keyboardHidden">
+        </activity>
+        <activity android:name="xhr" android:label="@string/app_name" 
+                  android:configChanges="orientation|keyboardHidden">
+        </activity>
+        </application>
+
+	<uses-sdk android:minSdkVersion="5" />
+</manifest> 

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/900be3af/test/README.md
----------------------------------------------------------------------
diff --git a/test/README.md b/test/README.md
new file mode 100755
index 0000000..be2df51
--- /dev/null
+++ b/test/README.md
@@ -0,0 +1,23 @@
+## Android Native Tests ##
+
+These tests are designed to verify Android native features and other Android specific features.
+
+Before running the tests, they need to be set up.
+
+1. Copy the version of cordova-x.y.z.js into assets/www directory
+2. Edit assets/www/cordova.js to reference the correct version
+3. Copy cordova-x.y.z.jar into libs directory
+
+To run from command line:
+
+4. Build by entering "ant debug install"
+5. Run tests by clicking on "CordovaTest" icon on device
+
+To run from Eclipse:
+
+4. Import Android project into Eclipse
+5. Ensure Project properties "Java Build Path" includes the lib/cordova-x.y.z.jar
+6. Create run configuration if not already created
+7. Run tests 
+
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/900be3af/test/ant.properties
----------------------------------------------------------------------
diff --git a/test/ant.properties b/test/ant.properties
new file mode 100755
index 0000000..ee52d86
--- /dev/null
+++ b/test/ant.properties
@@ -0,0 +1,17 @@
+# This file is used to override default values used by the Ant build system.
+#
+# This file must be checked in Version Control Systems, as it is
+# integral to the build system of your project.
+
+# This file is only used by the Ant script.
+
+# You can use this to override default values such as
+#  'source.dir' for the location of your java source folder and
+#  'out.dir' for the location of your output folder.
+
+# You can also use it define how the release builds are signed by declaring
+# the following properties:
+#  'key.store' for the location of your keystore and
+#  'key.alias' for the name of the key to use.
+# The password will be asked during the build when you use the 'release' target.
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/900be3af/test/assets/www/backbuttonmultipage/index.html
----------------------------------------------------------------------
diff --git a/test/assets/www/backbuttonmultipage/index.html b/test/assets/www/backbuttonmultipage/index.html
new file mode 100755
index 0000000..35f4bc8
--- /dev/null
+++ b/test/assets/www/backbuttonmultipage/index.html
@@ -0,0 +1,23 @@
+<html> 
+<head> 
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
+<title>Backbutton</title> 
+<link rel="stylesheet" href="../master.css" type="text/css" media="screen" title="no title">
+<script type="text/javascript" charset="utf-8" src="../cordova.js"></script>
+<script type="text/javascript" charset="utf-8" src="../main.js"></script>
+
+<body onload="init();" id="stage" class="theme">
+    <h1>Cordova Android Tests</h1>
+    <div id="info">
+        <h4>Platform: <span id="platform"> &nbsp;</span>,   Version:
<span id="version">&nbsp;</span></h4>
+        <h4>UUID: <span id="uuid"> &nbsp;</span>,   Name: <span
id="name">&nbsp;</span></h4>
+        <h4>Width: <span id="width"> &nbsp;</span>,   Height: <span
id="height">&nbsp;</span>, Color Depth: <span id="colorDepth"></span></h4>
+    </div>
+    <div id="info">
+        <h4>Page 1</h4>
+        Go to next page.<br>
+        If returning from previous page, press "backbutton".  You should exit this app.
+    </div>
+    <a href="sample2.html" class="btn large">Next page</a>
+</body> 
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/900be3af/test/assets/www/backbuttonmultipage/sample2.html
----------------------------------------------------------------------
diff --git a/test/assets/www/backbuttonmultipage/sample2.html b/test/assets/www/backbuttonmultipage/sample2.html
new file mode 100755
index 0000000..ad6f960
--- /dev/null
+++ b/test/assets/www/backbuttonmultipage/sample2.html
@@ -0,0 +1,23 @@
+<html> 
+<head> 
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
+<title>Backbutton</title> 
+<link rel="stylesheet" href="../master.css" type="text/css" media="screen" title="no title">
+<script type="text/javascript" charset="utf-8" src="../cordova.js"></script>
+<script type="text/javascript" charset="utf-8" src="../main.js"></script>
+
+<body onload="init();" id="stage" class="theme">
+    <h1>Cordova Android Tests</h1>
+    <div id="info">
+        <h4>Platform: <span id="platform"> &nbsp;</span>,   Version:
<span id="version">&nbsp;</span></h4>
+        <h4>UUID: <span id="uuid"> &nbsp;</span>,   Name: <span
id="name">&nbsp;</span></h4>
+        <h4>Width: <span id="width"> &nbsp;</span>,   Height: <span
id="height">&nbsp;</span>, Color Depth: <span id="colorDepth"></span></h4>
+    </div>
+    <div id="info">
+        <h4>Page 2</h4>
+        Go to next page.<br>
+        If returning from previous page, press "backbutton".  You should go to Page 1.
+    </div>
+    <a href="sample3.html" class="btn large">Next page</a>
+</body> 
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/900be3af/test/assets/www/backbuttonmultipage/sample3.html
----------------------------------------------------------------------
diff --git a/test/assets/www/backbuttonmultipage/sample3.html b/test/assets/www/backbuttonmultipage/sample3.html
new file mode 100755
index 0000000..2238536
--- /dev/null
+++ b/test/assets/www/backbuttonmultipage/sample3.html
@@ -0,0 +1,26 @@
+<html> 
+<head> 
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
+<title>Backbutton</title> 
+<link rel="stylesheet" href="../master.css" type="text/css" media="screen" title="no title">
+<script type="text/javascript" charset="utf-8" src="../cordova.js"></script>
+<script type="text/javascript" charset="utf-8" src="../main.js"></script>
+
+<body onload="init();" id="stage" class="theme">
+    <h1>Cordova Android Tests</h1>
+    <div id="info">
+        <h4>Platform: <span id="platform"> &nbsp;</span>,   Version:
<span id="version">&nbsp;</span></h4>
+        <h4>UUID: <span id="uuid"> &nbsp;</span>,   Name: <span
id="name">&nbsp;</span></h4>
+        <h4>Width: <span id="width"> &nbsp;</span>,   Height: <span
id="height">&nbsp;</span>, Color Depth: <span id="colorDepth"></span></h4>
+    </div>
+    <div id="info">
+        <h4>Page 3</h4>
+        Press the 3 buttons below.  You should stay on same page.<br>
+        Press "backbutton" 4 times.  This will go back to #test3, #test2, #test1, then return
to previous Page 2.<br>
+        (NOTE: IS THIS CORRECT BEHAVIOR?)
+    </div>
+    <a href="sample3.html#test1" class="btn large">page3#test1</a>
+    <a href="sample3.html#test2" class="btn large">page3#test2</a>
+    <a href="sample3.html#test3" class="btn large">page3#test3</a>
+</body> 
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/900be3af/test/assets/www/background/index.html
----------------------------------------------------------------------
diff --git a/test/assets/www/background/index.html b/test/assets/www/background/index.html
new file mode 100755
index 0000000..62d7bbb
--- /dev/null
+++ b/test/assets/www/background/index.html
@@ -0,0 +1,99 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<head>
+<meta http-equiv="Content-type" content="text/html; charset=utf-8">
+<title>Background Page 1</title>
+<link rel="stylesheet" href="../master.css" type="text/css" media="screen" title="no title">
+<script type="text/javascript" charset="utf-8" src="../cordova.js"></script>
+
+<script type="text/javascript" charset="utf-8">
+
+	function onLoad() {
+		console.log("Page1: onload");
+		log("Page1: onload @ " + new Date().toLocaleTimeString());
+		document.addEventListener("deviceready", onDeviceReady, false);
+	}
+
+	function onUnLoaded() {
+		console.log("Page1: onunload");
+		log("Page1: onunload @ " + new Date().toLocaleTimeString());
+	}
+
+	function onDeviceReady() {
+		// Register the event listener
+		document.getElementById("platform").innerHTML = device.platform;
+		document.getElementById("version").innerHTML = device.version;
+		document.getElementById("uuid").innerHTML = device.uuid;
+		document.getElementById("name").innerHTML = device.name;
+		document.getElementById("width").innerHTML = screen.width;
+		document.getElementById("height").innerHTML = screen.height;
+		document.getElementById("colorDepth").innerHTML = screen.colorDepth;
+
+		document.addEventListener("pause", onPause, false);
+		document.addEventListener("resume", onResume, false);
+		
+		window.setInterval(function() {
+			log("Page1: Running");
+		}, 2000);
+	}
+
+	function onPause() {
+		console.log("Page1: onpause");
+		log("Page1: onpause @ " + new Date().toLocaleTimeString());
+	}
+
+	function onResume() {
+		console.log("Page1: onresume");
+		log("Page1: onresume @ " + new Date().toLocaleTimeString());
+	}
+
+	function log(s) {
+		var el = document.getElementById('status');
+		var status = el.innerHTML + s + "<br>";
+		el.innerHTML = status;
+		localStorage.backgroundstatus = status;
+	}
+	
+	function clearStatus() {
+		console.log("clear()");
+		localStorage.backgroundstatus = "";
+		document.getElementById('status').innerHTML = "";
+	}
+		
+</script>
+</head>
+<body onload="onLoad()" onunload="onUnLoaded()"  id="stage" class="theme">
+	<h1>Events</h1>
+	<div id="info">
+		<h4>
+			Platform: <span id="platform"> &nbsp;</span>, Version: <span
+				id="version">&nbsp;</span>
+		</h4>
+		<h4>
+			UUID: <span id="uuid"> &nbsp;</span>, Name: <span id="name">&nbsp;</span>
+		</h4>
+		<h4>
+			Width: <span id="width"> &nbsp;</span>, Height: <span id="height">&nbsp;
+			</span>, Color Depth: <span id="colorDepth"></span>
+		</h4>
+	</div>
+	<div id="info">
+	   Press "Home" button, then return to this app to see pause/resume.<br>
+	   There shouldn't be any "Running" entries between pause and resume.<br>
+	</div>
+	<div id="info">
+	   <h4>Info for event testing:</h4>
+	   <div id="status"></div>
+	</div>
+    
+    <!--  a href="index2.html" class="btn large" >Load new page</a -->
+    <a href="javascript:" class="btn large" onclick="clearStatus();">Clear status</a>
+    
+    <script>
+    document.getElementById('status').innerHTML = localStorage.backgroundstatus;
+    </script>
+</body>
+</html>
+
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/900be3af/test/assets/www/background/index2.html
----------------------------------------------------------------------
diff --git a/test/assets/www/background/index2.html b/test/assets/www/background/index2.html
new file mode 100755
index 0000000..f0dd2b9
--- /dev/null
+++ b/test/assets/www/background/index2.html
@@ -0,0 +1,98 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<head>
+<meta http-equiv="Content-type" content="text/html; charset=utf-8">
+<title>Background Page 2</title>
+<link rel="stylesheet" href="../master.css" type="text/css" media="screen" title="no title">
+<script type="text/javascript" charset="utf-8" src="../cordova.js"></script>
+
+<script type="text/javascript" charset="utf-8">
+
+    function onLoad() {
+        console.log("Page2: onload");
+        log("Page2: onload @ " + new Date().toLocaleTimeString());
+        document.addEventListener("deviceready", onDeviceReady, false);
+    }
+
+    function onUnLoaded() {
+        console.log("Page2: onunload");
+        log("Page2: onunload @ " + new Date().toLocaleTimeString());
+    }
+
+    function onDeviceReady() {
+        // Register the event listener
+        document.getElementById("platform").innerHTML = device.platform;
+        document.getElementById("version").innerHTML = device.version;
+        document.getElementById("uuid").innerHTML = device.uuid;
+        document.getElementById("name").innerHTML = device.name;
+        document.getElementById("width").innerHTML = screen.width;
+        document.getElementById("height").innerHTML = screen.height;
+        document.getElementById("colorDepth").innerHTML = screen.colorDepth;
+
+        document.addEventListener("pause", onPause, false);
+        document.addEventListener("resume", onResume, false);
+
+        window.setInterval(function() {
+            log("Page2: Running");
+        }, 2000);
+}
+
+    function onPause() {
+        console.log("Page2: onpause");
+        log("Page2: onpause @ " + new Date().toLocaleTimeString());
+    }
+
+    function onResume() {
+        console.log("Page2: onresume");
+        log("Page2: onresume @ " + new Date().toLocaleTimeString());
+    }
+
+    function log(s) {
+        var el = document.getElementById('status');
+        var status = el.innerHTML + s + "<br>";
+        el.innerHTML = status;
+        localStorage.backgroundstatus = status;
+    }
+    
+    function clearStatus() {
+        console.log("clear()");
+        localStorage.backgroundstatus = "";
+        document.getElementById('status').innerHTML = "";
+    }
+        
+</script>
+</head>
+<body onload="onLoad()" onunload="onUnLoaded()"  id="stage" class="theme">
+    <h1>Events</h1>
+    <div id="info">
+        <h4>
+            Platform: <span id="platform"> &nbsp;</span>, Version: <span
+                id="version">&nbsp;</span>
+        </h4>
+        <h4>
+            UUID: <span id="uuid"> &nbsp;</span>, Name: <span id="name">&nbsp;</span>
+        </h4>
+        <h4>
+            Width: <span id="width"> &nbsp;</span>, Height: <span id="height">&nbsp;
+            </span>, Color Depth: <span id="colorDepth"></span>
+        </h4>
+    </div>
+    <div id="info">
+       <h4>Press "Back" button to return to Page 1.</h4>
+    </div>
+    <div id="info">
+       <h4>Info for event testing:</h4>
+       <div id="status"></div>
+    </div>
+    
+    <a href="index.html" class="btn large" >Load new page</a>
+    <a href="javascript:" class="btn large" onclick="clearStatus();">Clear status</a>
+    
+    <script>
+    document.getElementById('status').innerHTML = localStorage.backgroundstatus;
+    </script>
+</body>
+</html>
+
+


Mime
View raw message