From 7a816d845427a8c069684c96a1697b7232c3391b Mon Sep 17 00:00:00 2001 From: Marcel Kinard Date: Mon, 27 Oct 2014 12:23:10 -0400 Subject: [PATCH] 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. --- tests/tests.js | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/tests.js b/tests/tests.js index f2bbc2f..c52eda7 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://www.google.com and https://www.google.com are white listed.
' + + 'Make sure http://cordova.apache.org and http://google.co.uk and https://www.google.co.uk 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: ' + @@ -193,17 +193,17 @@ exports.defineManualTests = function (contentEl, createActionButton) { var white_listed_tests = '

White Listed URL

' + '
' + - 'Expected result: open successfully in CordovaWebView to www.google.com' + + 'Expected result: open successfully in CordovaWebView to cordova.apache.org' + '

' + - 'Expected result: open successfully in CordovaWebView to www.google.com' + + 'Expected result: open successfully in CordovaWebView to cordova.apache.org' + '

' + - 'Expected result: open successfully in system browser to www.google.com' + + 'Expected result: open successfully in system browser to cordova.apache.org' + '

' + - 'Expected result: open successfully in InAppBrowser to www.google.com' + + 'Expected result: open successfully in InAppBrowser to cordova.apache.org' + '

' + - 'Expected result: open successfully in InAppBrowser to www.google.com' + + 'Expected result: open successfully in InAppBrowser to cordova.apache.org' + '

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

Non White Listed URL

' + '
' + @@ -221,7 +221,7 @@ exports.defineManualTests = function (contentEl, createActionButton) { var page_with_redirects_tests = '

Page with redirect

' + '
' + - '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.' + '

' + 'Expected result: should 302 and open successfully in InAppBrowser to www.zhihu.com/answer/16714076.'; @@ -263,11 +263,11 @@ exports.defineManualTests = function (contentEl, createActionButton) { '
' + 'Expected result: no additional browser window. Alert appears with the text "background window loaded".' + '

' + - '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.' + '

' + 'Expected result: no output. But click on "show hidden" again and nothing should be shown.' + '

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

Clearing Cache

' + '
' + @@ -336,22 +336,22 @@ exports.defineManualTests = function (contentEl, createActionButton) { //White Listed createActionButton('* target=Default', function () { - doOpen('https://www.google.com'); + doOpen('http://cordova.apache.org'); }, 'openWhiteListed'); createActionButton('* target=_self', function () { - doOpen('https://www.google.com', '_self'); + doOpen('http://cordova.apache.org', '_self'); }, 'openWhiteListedSelf'); createActionButton('target=_system', function () { - doOpen('https://www.google.com', '_system'); + doOpen('http://cordova.apache.org', '_system'); }, 'openWhiteListedSystem'); createActionButton('target=_blank', function () { - doOpen('https://www.google.com', '_blank'); + doOpen('http://cordova.apache.org', '_blank'); }, 'openWhiteListedBlank'); createActionButton('target=Random', function () { - doOpen('https://www.google.com', 'random_string'); + doOpen('http://cordova.apache.org', 'random_string'); }, 'openWhiteListedRandom'); 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'); //Non White Listed @@ -375,8 +375,8 @@ exports.defineManualTests = function (contentEl, createActionButton) { }, 'openNonWhiteListedRandomNoLocation'); //Page with redirect - createActionButton('http://google.com', function () { - doOpen('http://google.com', 'random_string', '', 1); + createActionButton('http://google.co.uk', function () { + doOpen('http://google.co.uk', 'random_string', '', 1); }, 'openRedirect301'); createActionButton('http://goo.gl/pUFqg', function () { doOpen('http://goo.gl/pUFqg', 'random_string', '', 2); @@ -432,7 +432,7 @@ exports.defineManualTests = function (contentEl, createActionButton) { //Open hidden createActionButton('Create Hidden', function () { - openHidden('https://www.google.com', true); + openHidden('https://www.google.co.uk', true); }, 'openHidden'); createActionButton('Show Hidden', function () { showHidden(); @@ -440,16 +440,16 @@ exports.defineManualTests = function (contentEl, createActionButton) { createActionButton('Close Hidden', function () { closeHidden(); }, 'closeHidden'); - createActionButton('google.com Not Hidden', function () { - openHidden('https://www.google.com', false); + createActionButton('google.co.uk Not Hidden', function () { + openHidden('https://www.google.co.uk', false); }, 'openHiddenShow'); //Clearing cache createActionButton('Clear Browser Cache', function () { - doOpen('https://www.google.com', '_blank', 'clearcache=yes'); + doOpen('https://www.google.co.uk', '_blank', 'clearcache=yes'); }, 'openClearCache'); createActionButton('Clear Session Cache', function () { - doOpen('https://www.google.com', '_blank', 'clearsessioncache=yes'); + doOpen('https://www.google.co.uk', '_blank', 'clearsessioncache=yes'); }, 'openClearSessionCache'); //Video tag