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:
parent
81161ebe66
commit
4f957919c7
@ -27,5 +27,5 @@
|
|||||||
<js-module src="tests.js" name="tests">
|
<js-module src="tests.js" name="tests">
|
||||||
</js-module>
|
</js-module>
|
||||||
|
|
||||||
<asset src="resources" target="resources" />
|
<asset src="resources" target="cdvtests/iab-resources" />
|
||||||
</plugin>
|
</plugin>
|
||||||
|
@ -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 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 -->
|
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- ISO-8859-1 -->
|
||||||
<title>Cordova Mobile Spec</title>
|
<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>
|
</head>
|
||||||
<body id="stage" class="theme">
|
<body id="stage" class="theme">
|
||||||
<h1 id="header">InAppBrowser - Script / Style Injection Test</h1>
|
<h1 id="header">InAppBrowser - Script / Style Injection Test</h1>
|
||||||
|
@ -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 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 -->
|
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- ISO-8859-1 -->
|
||||||
<title>IAB test page</title>
|
<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">
|
<script type="text/javascript" charset="utf-8">
|
||||||
function onDeviceReady() {
|
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.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);
|
document.addEventListener("deviceready", onDeviceReady, false);
|
||||||
</script>
|
</script>
|
||||||
|
<style>
|
||||||
|
body {background-color: #ffffff;}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body id="stage" class="theme">
|
<body id="stage" class="theme">
|
||||||
<h1>Local URL</h1>
|
<h1>Local URL</h1>
|
||||||
|
@ -167,7 +167,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
|
|||||||
|
|
||||||
var info_div = '<h1>InAppBrowser</h1>' +
|
var info_div = '<h1>InAppBrowser</h1>' +
|
||||||
'<div id="info">' +
|
'<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>' +
|
'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>' +
|
'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>' +
|
'<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 +
|
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;
|
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',
|
var localhtml = basePath + 'local.html',
|
||||||
localpdf = basePath + 'local.pdf',
|
localpdf = basePath + 'local.pdf',
|
||||||
injecthtml = basePath + 'inject.html',
|
injecthtml = basePath + 'inject.html',
|
||||||
@ -298,8 +301,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
|
|||||||
|
|
||||||
//Local
|
//Local
|
||||||
createActionButton('target=Default', function () {
|
createActionButton('target=Default', function () {
|
||||||
console.log(localhtml);
|
doOpen(localhtml);
|
||||||
//doOpen(localhtml);
|
|
||||||
}, 'openLocal');
|
}, 'openLocal');
|
||||||
createActionButton('target=_self', function () {
|
createActionButton('target=_self', function () {
|
||||||
doOpen(localhtml, '_self');
|
doOpen(localhtml, '_self');
|
||||||
@ -325,22 +327,22 @@ exports.defineManualTests = function (contentEl, createActionButton) {
|
|||||||
|
|
||||||
//White Listed
|
//White Listed
|
||||||
createActionButton('* target=Default', function () {
|
createActionButton('* target=Default', function () {
|
||||||
doOpen('http://www.google.com');
|
doOpen('https://www.google.com');
|
||||||
}, 'openWhiteListed');
|
}, 'openWhiteListed');
|
||||||
createActionButton('* target=_self', function () {
|
createActionButton('* target=_self', function () {
|
||||||
doOpen('http://www.google.com', '_self');
|
doOpen('https://www.google.com', '_self');
|
||||||
}, 'openWhiteListedSelf');
|
}, 'openWhiteListedSelf');
|
||||||
createActionButton('target=_system', function () {
|
createActionButton('target=_system', function () {
|
||||||
doOpen('http://www.google.com', '_system');
|
doOpen('https://www.google.com', '_system');
|
||||||
}, 'openWhiteListedSystem');
|
}, 'openWhiteListedSystem');
|
||||||
createActionButton('target=_blank', function () {
|
createActionButton('target=_blank', function () {
|
||||||
doOpen('http://www.google.com', '_blank');
|
doOpen('https://www.google.com', '_blank');
|
||||||
}, 'openWhiteListedBlank');
|
}, 'openWhiteListedBlank');
|
||||||
createActionButton('target=Random', function () {
|
createActionButton('target=Random', function () {
|
||||||
doOpen('http://www.google.com', 'random_string');
|
doOpen('https://www.google.com', 'random_string');
|
||||||
}, 'openWhiteListedRandom');
|
}, 'openWhiteListedRandom');
|
||||||
createActionButton('* target=Random, no location bar', function () {
|
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');
|
}, 'openWhiteListedRandomNoLocation');
|
||||||
|
|
||||||
//Non White Listed
|
//Non White Listed
|
||||||
|
Loading…
Reference in New Issue
Block a user