CB-7876 change test target to avoid undesired redirects

The google.com test target would do automatic redirects to geography-specific
domains depending on where the client is, which leads to different behavior
depending where the tester is. This causes confusion, as the test results
may be different in different geographies. Use a test target that doesn't do
that, so the test results are independent of geography.
This commit is contained in:
Marcel Kinard 2014-10-27 12:23:10 -04:00
parent 50a78baf22
commit 7a816d8454

View File

@ -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://www.google.com and https://www.google.com are white listed. </br>' + 'Make sure http://cordova.apache.org and http://google.co.uk and https://www.google.co.uk 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>' +
@ -193,17 +193,17 @@ exports.defineManualTests = function (contentEl, createActionButton) {
var white_listed_tests = '<h1>White Listed URL</h1>' + var white_listed_tests = '<h1>White Listed URL</h1>' +
'<div id="openWhiteListed"></div>' + '<div id="openWhiteListed"></div>' +
'Expected result: open successfully in CordovaWebView to www.google.com' + 'Expected result: open successfully in CordovaWebView to cordova.apache.org' +
'<p/> <div id="openWhiteListedSelf"></div>' + '<p/> <div id="openWhiteListedSelf"></div>' +
'Expected result: open successfully in CordovaWebView to www.google.com' + 'Expected result: open successfully in CordovaWebView to cordova.apache.org' +
'<p/> <div id="openWhiteListedSystem"></div>' + '<p/> <div id="openWhiteListedSystem"></div>' +
'Expected result: open successfully in system browser to www.google.com' + 'Expected result: open successfully in system browser to cordova.apache.org' +
'<p/> <div id="openWhiteListedBlank"></div>' + '<p/> <div id="openWhiteListedBlank"></div>' +
'Expected result: open successfully in InAppBrowser to www.google.com' + 'Expected result: open successfully in InAppBrowser to cordova.apache.org' +
'<p/> <div id="openWhiteListedRandom"></div>' + '<p/> <div id="openWhiteListedRandom"></div>' +
'Expected result: open successfully in InAppBrowser to www.google.com' + 'Expected result: open successfully in InAppBrowser to cordova.apache.org' +
'<p/> <div id="openWhiteListedRandomNoLocation"></div>' + '<p/> <div id="openWhiteListedRandomNoLocation"></div>' +
'Expected result: open successfully in InAppBrowser to www.google.com with no location bar.'; 'Expected result: open successfully in InAppBrowser to cordova.apache.org with no location bar.';
var non_white_listed_tests = '<h1>Non White Listed URL</h1>' + var non_white_listed_tests = '<h1>Non White Listed URL</h1>' +
'<div id="openNonWhiteListed"></div>' + '<div id="openNonWhiteListed"></div>' +
@ -221,7 +221,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
var page_with_redirects_tests = '<h1>Page with redirect</h1>' + var page_with_redirects_tests = '<h1>Page with redirect</h1>' +
'<div id="openRedirect301"></div>' + '<div id="openRedirect301"></div>' +
'Expected result: should 301 and open successfully in InAppBrowser to www.google.com.' + 'Expected result: should 301 and open successfully in InAppBrowser to https://www.google.co.uk.' +
'<p/> <div id="openRedirect302"></div>' + '<p/> <div id="openRedirect302"></div>' +
'Expected result: should 302 and open successfully in InAppBrowser to www.zhihu.com/answer/16714076.'; 'Expected result: should 302 and open successfully in InAppBrowser to www.zhihu.com/answer/16714076.';
@ -263,11 +263,11 @@ exports.defineManualTests = function (contentEl, createActionButton) {
'<div id="openHidden"></div>' + '<div id="openHidden"></div>' +
'Expected result: no additional browser window. Alert appears with the text "background window loaded".' + 'Expected result: no additional browser window. Alert appears with the text "background window loaded".' +
'<p/> <div id="showHidden"></div>' + '<p/> <div id="showHidden"></div>' +
'Expected result: after first clicking on previous test "create hidden", open successfully in InAppBrowser to google.com.' + 'Expected result: after first clicking on previous test "create hidden", open successfully in InAppBrowser to https://www.google.co.uk.' +
'<p/> <div id="closeHidden"></div>' + '<p/> <div id="closeHidden"></div>' +
'Expected result: no output. But click on "show hidden" again and nothing should be shown.' + 'Expected result: no output. But click on "show hidden" again and nothing should be shown.' +
'<p/> <div id="openHiddenShow"></div>' + '<p/> <div id="openHiddenShow"></div>' +
'Expected result: open successfully in InAppBrowser to www.google.com'; 'Expected result: open successfully in InAppBrowser to https://www.google.co.uk';
var clearing_cache_tests = '<h1>Clearing Cache</h1>' + var clearing_cache_tests = '<h1>Clearing Cache</h1>' +
'<div id="openClearCache"></div>' + '<div id="openClearCache"></div>' +
@ -336,22 +336,22 @@ exports.defineManualTests = function (contentEl, createActionButton) {
//White Listed //White Listed
createActionButton('* target=Default', function () { createActionButton('* target=Default', function () {
doOpen('https://www.google.com'); doOpen('http://cordova.apache.org');
}, 'openWhiteListed'); }, 'openWhiteListed');
createActionButton('* target=_self', function () { createActionButton('* target=_self', function () {
doOpen('https://www.google.com', '_self'); doOpen('http://cordova.apache.org', '_self');
}, 'openWhiteListedSelf'); }, 'openWhiteListedSelf');
createActionButton('target=_system', function () { createActionButton('target=_system', function () {
doOpen('https://www.google.com', '_system'); doOpen('http://cordova.apache.org', '_system');
}, 'openWhiteListedSystem'); }, 'openWhiteListedSystem');
createActionButton('target=_blank', function () { createActionButton('target=_blank', function () {
doOpen('https://www.google.com', '_blank'); doOpen('http://cordova.apache.org', '_blank');
}, 'openWhiteListedBlank'); }, 'openWhiteListedBlank');
createActionButton('target=Random', function () { createActionButton('target=Random', function () {
doOpen('https://www.google.com', 'random_string'); doOpen('http://cordova.apache.org', 'random_string');
}, 'openWhiteListedRandom'); }, 'openWhiteListedRandom');
createActionButton('* target=Random, no location bar', function () { createActionButton('* target=Random, no location bar', function () {
doOpen('https://www.google.com', 'random_string', 'location=no'); doOpen('http://cordova.apache.org', 'random_string', 'location=no');
}, 'openWhiteListedRandomNoLocation'); }, 'openWhiteListedRandomNoLocation');
//Non White Listed //Non White Listed
@ -375,8 +375,8 @@ exports.defineManualTests = function (contentEl, createActionButton) {
}, 'openNonWhiteListedRandomNoLocation'); }, 'openNonWhiteListedRandomNoLocation');
//Page with redirect //Page with redirect
createActionButton('http://google.com', function () { createActionButton('http://google.co.uk', function () {
doOpen('http://google.com', 'random_string', '', 1); doOpen('http://google.co.uk', 'random_string', '', 1);
}, 'openRedirect301'); }, 'openRedirect301');
createActionButton('http://goo.gl/pUFqg', function () { createActionButton('http://goo.gl/pUFqg', function () {
doOpen('http://goo.gl/pUFqg', 'random_string', '', 2); doOpen('http://goo.gl/pUFqg', 'random_string', '', 2);
@ -432,7 +432,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
//Open hidden //Open hidden
createActionButton('Create Hidden', function () { createActionButton('Create Hidden', function () {
openHidden('https://www.google.com', true); openHidden('https://www.google.co.uk', true);
}, 'openHidden'); }, 'openHidden');
createActionButton('Show Hidden', function () { createActionButton('Show Hidden', function () {
showHidden(); showHidden();
@ -440,16 +440,16 @@ exports.defineManualTests = function (contentEl, createActionButton) {
createActionButton('Close Hidden', function () { createActionButton('Close Hidden', function () {
closeHidden(); closeHidden();
}, 'closeHidden'); }, 'closeHidden');
createActionButton('google.com Not Hidden', function () { createActionButton('google.co.uk Not Hidden', function () {
openHidden('https://www.google.com', false); openHidden('https://www.google.co.uk', false);
}, 'openHiddenShow'); }, 'openHiddenShow');
//Clearing cache //Clearing cache
createActionButton('Clear Browser Cache', function () { createActionButton('Clear Browser Cache', function () {
doOpen('https://www.google.com', '_blank', 'clearcache=yes'); doOpen('https://www.google.co.uk', '_blank', 'clearcache=yes');
}, 'openClearCache'); }, 'openClearCache');
createActionButton('Clear Session Cache', function () { createActionButton('Clear Session Cache', function () {
doOpen('https://www.google.com', '_blank', 'clearsessioncache=yes'); doOpen('https://www.google.co.uk', '_blank', 'clearsessioncache=yes');
}, 'openClearSessionCache'); }, 'openClearSessionCache');
//Video tag //Video tag