From 4f957919c76205e33569c11f0cd71555c9166ec8 Mon Sep 17 00:00:00 2001 From: Marcel Kinard Date: Wed, 27 Aug 2014 15:56:46 -0400 Subject: [PATCH] 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 --- 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(-) 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 @@ - + 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 @@ Cordova Mobile Spec - +

InAppBrowser - Script / Style Injection Test

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 @@ IAB test page - + +

Local URL

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 = '

InAppBrowser

' + '
' + - 'Make sure http://wwww.google.com is white listed.
' + + 'Make sure http://www.google.com and https://www.google.com are white listed.
' + 'Make sure http://www.apple.com is not in the white list.
' + 'In iOS, starred * tests will put the app in a state with no way to return.
' + '

User-Agent: ' + @@ -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