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
This commit is contained in:
Marcel Kinard 2014-08-27 15:56:46 -04:00
parent 81161ebe66
commit 4f957919c7
4 changed files with 18 additions and 13 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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