Permalink
Browse files

Add manual tests for InAppBrowser

  • Loading branch information...
1 parent b70273b commit fab6d8e6b3a96e30848a8761c4b5072e5695eea3 @macdonst macdonst committed Nov 21, 2012
Showing with 126 additions and 0 deletions.
  1. +85 −0 inappbrowser/index.html
  2. +40 −0 inappbrowser/local.html
  3. +1 −0 index.html
@@ -0,0 +1,85 @@
+<!DOCTYPE html>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+
+<html>
+ <head>
+ <meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,maximum-scale=1.0,initial-scale=1.0" />
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- ISO-8859-1 -->
+ <title>Cordova Mobile Spec</title>
+ <link rel="stylesheet" href="../master.css" type="text/css" media="screen" title="no title" charset="utf-8">
+ <script type="text/javascript" charset="utf-8" src="../cordova.js"></script>
+
+
+<script type="text/javascript" charset="utf-8">
+
+ var deviceReady = false;
+
+ /**
+ * Function called when page has finished loading.
+ */
+ function init() {
+ document.addEventListener("deviceready", function() {
+ deviceReady = true;
+ console.log("Device="+device.platform+" "+device.version);
+ }, false);
+ window.setTimeout(function() {
+ if (!deviceReady) {
+ alert("Error: Apache Cordova did not initialize. Demo will not run correctly.");
+ }
+ },1000);
+ }
+
+</script>
+
+ </head>
+ <body onload="init();" id="stage" class="theme">
+
+ <h1>InAppBrowser</h1>
+ <div id="info">
+ Make sure http://www.google.com is white listed
+ Make sure http://www.apple.com is not in the white list
+ </div>
+ <h1>Local URL</h1>
+ <div class="btn large" onclick="window.open('local.html');">Default: CordovaWebView</div>
+ <div class="btn large" onclick="window.open('local.html', '_self');">Target=Self: CordovaWebView</div>
+ <div class="btn large" onclick="window.open('local.html', '_system');">Target=System: Error</div>
+ <div class="btn large" onclick="window.open('local.html', '_blank');">Target=Blank: InAppBrowser</div>
+ <div class="btn large" onclick="window.open('local.html', 'random_string');">Target=Random: InAppBrowser</div>
+ <div class="btn large" onclick="window.open('local.html', 'random_string', 'location=no');">Target=Random, no location bar: InAppBrowser</div>
+ <h1>White Listed URL</h1>
+ <div class="btn large" onclick="window.open('http://www.google.com');">Default: CordovaWebView</div>
+ <div class="btn large" onclick="window.open('http://www.google.com', '_self');">Target=Self: CordovaWebView</div>
+ <div class="btn large" onclick="window.open('http://www.google.com', '_system');">Target=System: System Browser</div>
+ <div class="btn large" onclick="window.open('http://www.google.com', '_blank');">Target=Blank: InAppBrowser</div>
+ <div class="btn large" onclick="window.open('http://www.google.com', 'random_string');">Target=Random: InAppBrowser</div>
+ <div class="btn large" onclick="window.open('http://www.google.com', 'random_string', 'location=no');">Target=Random, no location bar: InAppBrowser</div>
+ <h1>Non White Listed URL</h1>
+ <div class="btn large" onclick="window.open('http://www.apple.com');">Default: InAppBrowser</div>
+ <div class="btn large" onclick="window.open('http://www.apple.com', '_self');">Target=Self: InAppBrowser</div>
+ <div class="btn large" onclick="window.open('http://www.apple.com', '_system');">Target=System: System</div>
+ <div class="btn large" onclick="window.open('http://www.apple.com', '_blank');">Target=Blank: InAppBrowser</div>
+ <div class="btn large" onclick="window.open('http://www.apple.com', 'random_string');">Target=Random: InAppBrowser</div>
+ <div class="btn large" onclick="window.open('http://www.apple.com', 'random_string', 'location=no');">Target=Random, no location bar: InAppBrowser</div>
+ <h2> </h2><div class="backBtn" onclick="backHome();">Back</div>
+ </body>
+</html>
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+
+<html>
+ <head>
+ <meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,maximum-scale=1.0,initial-scale=1.0" />
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- ISO-8859-1 -->
+ <title>Cordova Mobile Spec</title>
+ <link rel="stylesheet" href="../master.css" type="text/css" media="screen" title="no title" charset="utf-8">
+ <script type="text/javascript" charset="utf-8" src="../cordova.js"></script>
+ </head>
+ <body id="stage" class="theme">
+
+ <h1>InAppBrowser - Local URL</h1>
+ <div id="info">
+ You have successfully loaded a local URL
+ </div>
+ <h2> </h2><div class="backBtn" onclick="backHome();">Back</div>
+ </body>
+</html>
View
@@ -57,5 +57,6 @@
<a href="sql/index.html" class="btn large">Web SQL</a>
<a href="storage/index.html" class="btn large">Local Storage</a>
<a href="execbenchmark/index.html" class="btn large">Benchmark exec()</a>
+ <a href="inappbrowser/index.html" class="btn large">In App Browser</a>
</body>
</html>

0 comments on commit fab6d8e

Please sign in to comment.