cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject git commit: CB-7133 fix up the tests for Android
Date Wed, 27 Aug 2014 19:58:15 GMT
Repository: cordova-plugin-inappbrowser
Updated Branches:
  refs/heads/master 81161ebe6 -> 4f957919c


CB-7133 fix up the tests for Android

- move the resources from /resources to /cdvtests/iab-resources
- change the url of the resources from absolute to relative
- explicitly set the background color of local.html to be white because it was inheriting
black
- add the js to display the user-agent on the tests menu
- change the www.google.com URL from http to https to avoid an unexpected redirect


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/4f957919
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/4f957919
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/4f957919

Branch: refs/heads/master
Commit: 4f957919c76205e33569c11f0cd71555c9166ec8
Parents: 81161eb
Author: Marcel Kinard <cmarcelk@gmail.com>
Authored: Wed Aug 27 15:56:46 2014 -0400
Committer: Marcel Kinard <cmarcelk@gmail.com>
Committed: Wed Aug 27 15:57:33 2014 -0400

----------------------------------------------------------------------
 tests/plugin.xml            |  2 +-
 tests/resources/inject.html |  2 +-
 tests/resources/local.html  |  5 ++++-
 tests/tests.js              | 22 ++++++++++++----------
 4 files changed, 18 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/4f957919/tests/plugin.xml
----------------------------------------------------------------------
diff --git a/tests/plugin.xml b/tests/plugin.xml
index 2a386f8..fba7ad5 100644
--- a/tests/plugin.xml
+++ b/tests/plugin.xml
@@ -27,5 +27,5 @@
     <js-module src="tests.js" name="tests">
     </js-module>
 
-    <asset src="resources" target="resources" />
+    <asset src="resources" target="cdvtests/iab-resources" />
 </plugin>

http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/4f957919/tests/resources/inject.html
----------------------------------------------------------------------
diff --git a/tests/resources/inject.html b/tests/resources/inject.html
index 0f1efdd..a2584a0 100644
--- a/tests/resources/inject.html
+++ b/tests/resources/inject.html
@@ -26,7 +26,7 @@
     <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">
+    <link rel="stylesheet" href="../../master.css" type="text/css" media="screen" title="no
title" charset="utf-8">
   </head>
   <body id="stage" class="theme">
     <h1 id="header">InAppBrowser - Script / Style Injection Test</h1>

http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/4f957919/tests/resources/local.html
----------------------------------------------------------------------
diff --git a/tests/resources/local.html b/tests/resources/local.html
index 5e33800..d23a714 100644
--- a/tests/resources/local.html
+++ b/tests/resources/local.html
@@ -26,13 +26,16 @@
     <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>IAB test page</title>
-    <script type="text/javascript" charset="utf-8" src="../cordova-incl.js"></script>
+    <script type="text/javascript" charset="utf-8" src="../../cordova-incl.js"></script>
     <script type="text/javascript" charset="utf-8">
       function onDeviceReady() {
           document.getElementById("hint").textContent = "Running CordovaWebView, deviceVersion="
+ device.version + ", no toolbar should be present, Back link should work, logcat should NOT
have failed 'gap:' calls.";
       }
       document.addEventListener("deviceready", onDeviceReady, false);
     </script>
+    <style>
+        body {background-color: #ffffff;}
+    </style>
   </head>
   <body id="stage" class="theme">
     <h1>Local URL</h1>

http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/4f957919/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index 4a08849..6642f16 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -167,7 +167,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
 
     var info_div = '<h1>InAppBrowser</h1>' +
         '<div id="info">' +
-        'Make sure http://wwww.google.com is white listed. </br>' +
+        'Make sure http://www.google.com and https://www.google.com are white listed. </br>'
+
         'Make sure http://www.apple.com is not in the white list.</br>' +
         'In iOS, starred <span style="vertical-align:super">*</span> tests will
put the app in a state with no way to return. </br>' +
         '<h4>User-Agent: <span id="user-agent"> </span></hr>' +
@@ -288,7 +288,10 @@ exports.defineManualTests = function (contentEl, createActionButton)
{
     contentEl.innerHTML = info_div + local_tests + white_listed_tests + non_white_listed_tests
+ page_with_redirects_tests + pdf_url_tests + invalid_url_tests +
         css_js_injection_tests + open_hidden_tests + clearing_cache_tests + video_tag_tests
+ local_with_anchor_tag_tests;
 
-    var basePath = '/www/resources/';
+    document.getElementById("user-agent").textContent = navigator.userAgent;
+
+    // we are already in cdvtests directory
+    var basePath = 'iab-resources/';
     var localhtml = basePath + 'local.html',
         localpdf = basePath + 'local.pdf',
         injecthtml = basePath + 'inject.html',
@@ -298,8 +301,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
 
     //Local
     createActionButton('target=Default', function () {
-        console.log(localhtml);
-        //doOpen(localhtml);
+        doOpen(localhtml);
     }, 'openLocal');
     createActionButton('target=_self', function () {
         doOpen(localhtml, '_self');
@@ -325,22 +327,22 @@ exports.defineManualTests = function (contentEl, createActionButton)
{
 
     //White Listed
     createActionButton('* target=Default', function () {
-        doOpen('http://www.google.com');
+        doOpen('https://www.google.com');
     }, 'openWhiteListed');
     createActionButton('* target=_self', function () {
-        doOpen('http://www.google.com', '_self');
+        doOpen('https://www.google.com', '_self');
     }, 'openWhiteListedSelf');
     createActionButton('target=_system', function () {
-        doOpen('http://www.google.com', '_system');
+        doOpen('https://www.google.com', '_system');
     }, 'openWhiteListedSystem');
     createActionButton('target=_blank', function () {
-        doOpen('http://www.google.com', '_blank');
+        doOpen('https://www.google.com', '_blank');
     }, 'openWhiteListedBlank');
     createActionButton('target=Random', function () {
-        doOpen('http://www.google.com', 'random_string');
+        doOpen('https://www.google.com', 'random_string');
     }, 'openWhiteListedRandom');
     createActionButton('* target=Random, no location bar', function () {
-        doOpen('http://www.google.com', 'random_string', 'location=no');
+        doOpen('https://www.google.com', 'random_string', 'location=no');
     }, 'openWhiteListedRandomNoLocation');
 
     //Non White Listed


Mime
View raw message