Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | * http://creativecommons.org/publicdomain/zero/1.0/ |
michael@0 | 3 | */ |
michael@0 | 4 | |
michael@0 | 5 | const xpi = RELATIVE_DIR + "addons/browser_installssl.xpi"; |
michael@0 | 6 | const redirect = RELATIVE_DIR + "redirect.sjs?"; |
michael@0 | 7 | const SUCCESS = 0; |
michael@0 | 8 | const NETWORK_FAILURE = AddonManager.ERROR_NETWORK_FAILURE; |
michael@0 | 9 | |
michael@0 | 10 | const HTTP = "http://example.com/"; |
michael@0 | 11 | const HTTPS = "https://example.com/"; |
michael@0 | 12 | const NOCERT = "https://nocert.example.com/"; |
michael@0 | 13 | const SELFSIGNED = "https://self-signed.example.com/"; |
michael@0 | 14 | const UNTRUSTED = "https://untrusted.example.com/"; |
michael@0 | 15 | const EXPIRED = "https://expired.example.com/"; |
michael@0 | 16 | |
michael@0 | 17 | const PREF_INSTALL_REQUIREBUILTINCERTS = "extensions.install.requireBuiltInCerts"; |
michael@0 | 18 | |
michael@0 | 19 | var gTests = []; |
michael@0 | 20 | var gStart = 0; |
michael@0 | 21 | var gLast = 0; |
michael@0 | 22 | var gPendingInstall = null; |
michael@0 | 23 | |
michael@0 | 24 | function test() { |
michael@0 | 25 | gStart = Date.now(); |
michael@0 | 26 | requestLongerTimeout(4); |
michael@0 | 27 | waitForExplicitFinish(); |
michael@0 | 28 | |
michael@0 | 29 | registerCleanupFunction(function() { |
michael@0 | 30 | var cos = Cc["@mozilla.org/security/certoverride;1"]. |
michael@0 | 31 | getService(Ci.nsICertOverrideService); |
michael@0 | 32 | cos.clearValidityOverride("nocert.example.com", -1); |
michael@0 | 33 | cos.clearValidityOverride("self-signed.example.com", -1); |
michael@0 | 34 | cos.clearValidityOverride("untrusted.example.com", -1); |
michael@0 | 35 | cos.clearValidityOverride("expired.example.com", -1); |
michael@0 | 36 | |
michael@0 | 37 | try { |
michael@0 | 38 | Services.prefs.clearUserPref(PREF_INSTALL_REQUIREBUILTINCERTS); |
michael@0 | 39 | } |
michael@0 | 40 | catch (e) { |
michael@0 | 41 | } |
michael@0 | 42 | |
michael@0 | 43 | if (gPendingInstall) { |
michael@0 | 44 | gTests = []; |
michael@0 | 45 | ok(false, "Timed out in the middle of downloading " + gPendingInstall.sourceURI.spec); |
michael@0 | 46 | try { |
michael@0 | 47 | gPendingInstall.cancel(); |
michael@0 | 48 | } |
michael@0 | 49 | catch (e) { |
michael@0 | 50 | } |
michael@0 | 51 | } |
michael@0 | 52 | }); |
michael@0 | 53 | |
michael@0 | 54 | run_next_test(); |
michael@0 | 55 | } |
michael@0 | 56 | |
michael@0 | 57 | function end_test() { |
michael@0 | 58 | info("All tests completed in " + (Date.now() - gStart) + "ms"); |
michael@0 | 59 | finish(); |
michael@0 | 60 | } |
michael@0 | 61 | |
michael@0 | 62 | function add_install_test(mainURL, redirectURL, expectedStatus) { |
michael@0 | 63 | gTests.push([mainURL, redirectURL, expectedStatus]); |
michael@0 | 64 | } |
michael@0 | 65 | |
michael@0 | 66 | function run_install_tests(callback) { |
michael@0 | 67 | function run_next_install_test() { |
michael@0 | 68 | if (gTests.length == 0) { |
michael@0 | 69 | callback(); |
michael@0 | 70 | return; |
michael@0 | 71 | } |
michael@0 | 72 | gLast = Date.now(); |
michael@0 | 73 | |
michael@0 | 74 | let [mainURL, redirectURL, expectedStatus] = gTests.shift(); |
michael@0 | 75 | if (redirectURL) { |
michael@0 | 76 | var url = mainURL + redirect + redirectURL + xpi; |
michael@0 | 77 | var message = "Should have seen the right result for an install redirected from " + |
michael@0 | 78 | mainURL + " to " + redirectURL; |
michael@0 | 79 | } |
michael@0 | 80 | else { |
michael@0 | 81 | url = mainURL + xpi; |
michael@0 | 82 | message = "Should have seen the right result for an install from " + |
michael@0 | 83 | mainURL; |
michael@0 | 84 | } |
michael@0 | 85 | |
michael@0 | 86 | AddonManager.getInstallForURL(url, function(install) { |
michael@0 | 87 | gPendingInstall = install; |
michael@0 | 88 | install.addListener({ |
michael@0 | 89 | onDownloadEnded: function(install) { |
michael@0 | 90 | is(SUCCESS, expectedStatus, message); |
michael@0 | 91 | info("Install test ran in " + (Date.now() - gLast) + "ms"); |
michael@0 | 92 | // Don't proceed with the install |
michael@0 | 93 | install.cancel(); |
michael@0 | 94 | gPendingInstall = null; |
michael@0 | 95 | run_next_install_test(); |
michael@0 | 96 | return false; |
michael@0 | 97 | }, |
michael@0 | 98 | |
michael@0 | 99 | onDownloadFailed: function(install) { |
michael@0 | 100 | is(install.error, expectedStatus, message); |
michael@0 | 101 | info("Install test ran in " + (Date.now() - gLast) + "ms"); |
michael@0 | 102 | gPendingInstall = null; |
michael@0 | 103 | run_next_install_test(); |
michael@0 | 104 | } |
michael@0 | 105 | }); |
michael@0 | 106 | install.install(); |
michael@0 | 107 | }, "application/x-xpinstall"); |
michael@0 | 108 | } |
michael@0 | 109 | |
michael@0 | 110 | run_next_install_test(); |
michael@0 | 111 | } |
michael@0 | 112 | |
michael@0 | 113 | // Add overrides for the bad certificates |
michael@0 | 114 | function addCertOverrides() { |
michael@0 | 115 | addCertOverride("nocert.example.com", Ci.nsICertOverrideService.ERROR_MISMATCH); |
michael@0 | 116 | addCertOverride("self-signed.example.com", Ci.nsICertOverrideService.ERROR_UNTRUSTED); |
michael@0 | 117 | addCertOverride("untrusted.example.com", Ci.nsICertOverrideService.ERROR_UNTRUSTED); |
michael@0 | 118 | addCertOverride("expired.example.com", Ci.nsICertOverrideService.ERROR_TIME); |
michael@0 | 119 | } |
michael@0 | 120 | |
michael@0 | 121 | // Runs tests with built-in certificates required, no certificate exceptions |
michael@0 | 122 | // and no hashes |
michael@0 | 123 | add_test(function() { |
michael@0 | 124 | // Tests that a simple install works as expected. |
michael@0 | 125 | add_install_test(HTTP, null, SUCCESS); |
michael@0 | 126 | add_install_test(HTTPS, null, NETWORK_FAILURE); |
michael@0 | 127 | add_install_test(NOCERT, null, NETWORK_FAILURE); |
michael@0 | 128 | add_install_test(SELFSIGNED, null, NETWORK_FAILURE); |
michael@0 | 129 | add_install_test(UNTRUSTED, null, NETWORK_FAILURE); |
michael@0 | 130 | add_install_test(EXPIRED, null, NETWORK_FAILURE); |
michael@0 | 131 | |
michael@0 | 132 | // Tests that redirecting from http to other servers works as expected |
michael@0 | 133 | add_install_test(HTTP, HTTP, SUCCESS); |
michael@0 | 134 | add_install_test(HTTP, HTTPS, SUCCESS); |
michael@0 | 135 | add_install_test(HTTP, NOCERT, NETWORK_FAILURE); |
michael@0 | 136 | add_install_test(HTTP, SELFSIGNED, NETWORK_FAILURE); |
michael@0 | 137 | add_install_test(HTTP, UNTRUSTED, NETWORK_FAILURE); |
michael@0 | 138 | add_install_test(HTTP, EXPIRED, NETWORK_FAILURE); |
michael@0 | 139 | |
michael@0 | 140 | // Tests that redirecting from valid https to other servers works as expected |
michael@0 | 141 | add_install_test(HTTPS, HTTP, NETWORK_FAILURE); |
michael@0 | 142 | add_install_test(HTTPS, HTTPS, NETWORK_FAILURE); |
michael@0 | 143 | add_install_test(HTTPS, NOCERT, NETWORK_FAILURE); |
michael@0 | 144 | add_install_test(HTTPS, SELFSIGNED, NETWORK_FAILURE); |
michael@0 | 145 | add_install_test(HTTPS, UNTRUSTED, NETWORK_FAILURE); |
michael@0 | 146 | add_install_test(HTTPS, EXPIRED, NETWORK_FAILURE); |
michael@0 | 147 | |
michael@0 | 148 | // Tests that redirecting from nocert https to other servers works as expected |
michael@0 | 149 | add_install_test(NOCERT, HTTP, NETWORK_FAILURE); |
michael@0 | 150 | add_install_test(NOCERT, HTTPS, NETWORK_FAILURE); |
michael@0 | 151 | add_install_test(NOCERT, NOCERT, NETWORK_FAILURE); |
michael@0 | 152 | add_install_test(NOCERT, SELFSIGNED, NETWORK_FAILURE); |
michael@0 | 153 | add_install_test(NOCERT, UNTRUSTED, NETWORK_FAILURE); |
michael@0 | 154 | add_install_test(NOCERT, EXPIRED, NETWORK_FAILURE); |
michael@0 | 155 | |
michael@0 | 156 | // Tests that redirecting from self-signed https to other servers works as expected |
michael@0 | 157 | add_install_test(SELFSIGNED, HTTP, NETWORK_FAILURE); |
michael@0 | 158 | add_install_test(SELFSIGNED, HTTPS, NETWORK_FAILURE); |
michael@0 | 159 | add_install_test(SELFSIGNED, NOCERT, NETWORK_FAILURE); |
michael@0 | 160 | add_install_test(SELFSIGNED, SELFSIGNED, NETWORK_FAILURE); |
michael@0 | 161 | add_install_test(SELFSIGNED, UNTRUSTED, NETWORK_FAILURE); |
michael@0 | 162 | add_install_test(SELFSIGNED, EXPIRED, NETWORK_FAILURE); |
michael@0 | 163 | |
michael@0 | 164 | // Tests that redirecting from untrusted https to other servers works as expected |
michael@0 | 165 | add_install_test(UNTRUSTED, HTTP, NETWORK_FAILURE); |
michael@0 | 166 | add_install_test(UNTRUSTED, HTTPS, NETWORK_FAILURE); |
michael@0 | 167 | add_install_test(UNTRUSTED, NOCERT, NETWORK_FAILURE); |
michael@0 | 168 | add_install_test(UNTRUSTED, SELFSIGNED, NETWORK_FAILURE); |
michael@0 | 169 | add_install_test(UNTRUSTED, UNTRUSTED, NETWORK_FAILURE); |
michael@0 | 170 | add_install_test(UNTRUSTED, EXPIRED, NETWORK_FAILURE); |
michael@0 | 171 | |
michael@0 | 172 | // Tests that redirecting from expired https to other servers works as expected |
michael@0 | 173 | add_install_test(EXPIRED, HTTP, NETWORK_FAILURE); |
michael@0 | 174 | add_install_test(EXPIRED, HTTPS, NETWORK_FAILURE); |
michael@0 | 175 | add_install_test(EXPIRED, NOCERT, NETWORK_FAILURE); |
michael@0 | 176 | add_install_test(EXPIRED, SELFSIGNED, NETWORK_FAILURE); |
michael@0 | 177 | add_install_test(EXPIRED, UNTRUSTED, NETWORK_FAILURE); |
michael@0 | 178 | add_install_test(EXPIRED, EXPIRED, NETWORK_FAILURE); |
michael@0 | 179 | |
michael@0 | 180 | run_install_tests(run_next_test); |
michael@0 | 181 | }); |
michael@0 | 182 | |
michael@0 | 183 | // Runs tests without requiring built-in certificates, no certificate |
michael@0 | 184 | // exceptions and no hashes |
michael@0 | 185 | add_test(function() { |
michael@0 | 186 | Services.prefs.setBoolPref(PREF_INSTALL_REQUIREBUILTINCERTS, false); |
michael@0 | 187 | |
michael@0 | 188 | // Tests that a simple install works as expected. |
michael@0 | 189 | add_install_test(HTTP, null, SUCCESS); |
michael@0 | 190 | add_install_test(HTTPS, null, SUCCESS); |
michael@0 | 191 | add_install_test(NOCERT, null, NETWORK_FAILURE); |
michael@0 | 192 | add_install_test(SELFSIGNED, null, NETWORK_FAILURE); |
michael@0 | 193 | add_install_test(UNTRUSTED, null, NETWORK_FAILURE); |
michael@0 | 194 | add_install_test(EXPIRED, null, NETWORK_FAILURE); |
michael@0 | 195 | |
michael@0 | 196 | // Tests that redirecting from http to other servers works as expected |
michael@0 | 197 | add_install_test(HTTP, HTTP, SUCCESS); |
michael@0 | 198 | add_install_test(HTTP, HTTPS, SUCCESS); |
michael@0 | 199 | add_install_test(HTTP, NOCERT, NETWORK_FAILURE); |
michael@0 | 200 | add_install_test(HTTP, SELFSIGNED, NETWORK_FAILURE); |
michael@0 | 201 | add_install_test(HTTP, UNTRUSTED, NETWORK_FAILURE); |
michael@0 | 202 | add_install_test(HTTP, EXPIRED, NETWORK_FAILURE); |
michael@0 | 203 | |
michael@0 | 204 | // Tests that redirecting from valid https to other servers works as expected |
michael@0 | 205 | add_install_test(HTTPS, HTTP, NETWORK_FAILURE); |
michael@0 | 206 | add_install_test(HTTPS, HTTPS, SUCCESS); |
michael@0 | 207 | add_install_test(HTTPS, NOCERT, NETWORK_FAILURE); |
michael@0 | 208 | add_install_test(HTTPS, SELFSIGNED, NETWORK_FAILURE); |
michael@0 | 209 | add_install_test(HTTPS, UNTRUSTED, NETWORK_FAILURE); |
michael@0 | 210 | add_install_test(HTTPS, EXPIRED, NETWORK_FAILURE); |
michael@0 | 211 | |
michael@0 | 212 | // Tests that redirecting from nocert https to other servers works as expected |
michael@0 | 213 | add_install_test(NOCERT, HTTP, NETWORK_FAILURE); |
michael@0 | 214 | add_install_test(NOCERT, HTTPS, NETWORK_FAILURE); |
michael@0 | 215 | add_install_test(NOCERT, NOCERT, NETWORK_FAILURE); |
michael@0 | 216 | add_install_test(NOCERT, SELFSIGNED, NETWORK_FAILURE); |
michael@0 | 217 | add_install_test(NOCERT, UNTRUSTED, NETWORK_FAILURE); |
michael@0 | 218 | add_install_test(NOCERT, EXPIRED, NETWORK_FAILURE); |
michael@0 | 219 | |
michael@0 | 220 | // Tests that redirecting from self-signed https to other servers works as expected |
michael@0 | 221 | add_install_test(SELFSIGNED, HTTP, NETWORK_FAILURE); |
michael@0 | 222 | add_install_test(SELFSIGNED, HTTPS, NETWORK_FAILURE); |
michael@0 | 223 | add_install_test(SELFSIGNED, NOCERT, NETWORK_FAILURE); |
michael@0 | 224 | add_install_test(SELFSIGNED, SELFSIGNED, NETWORK_FAILURE); |
michael@0 | 225 | add_install_test(SELFSIGNED, UNTRUSTED, NETWORK_FAILURE); |
michael@0 | 226 | add_install_test(SELFSIGNED, EXPIRED, NETWORK_FAILURE); |
michael@0 | 227 | |
michael@0 | 228 | // Tests that redirecting from untrusted https to other servers works as expected |
michael@0 | 229 | add_install_test(UNTRUSTED, HTTP, NETWORK_FAILURE); |
michael@0 | 230 | add_install_test(UNTRUSTED, HTTPS, NETWORK_FAILURE); |
michael@0 | 231 | add_install_test(UNTRUSTED, NOCERT, NETWORK_FAILURE); |
michael@0 | 232 | add_install_test(UNTRUSTED, SELFSIGNED, NETWORK_FAILURE); |
michael@0 | 233 | add_install_test(UNTRUSTED, UNTRUSTED, NETWORK_FAILURE); |
michael@0 | 234 | add_install_test(UNTRUSTED, EXPIRED, NETWORK_FAILURE); |
michael@0 | 235 | |
michael@0 | 236 | // Tests that redirecting from expired https to other servers works as expected |
michael@0 | 237 | add_install_test(EXPIRED, HTTP, NETWORK_FAILURE); |
michael@0 | 238 | add_install_test(EXPIRED, HTTPS, NETWORK_FAILURE); |
michael@0 | 239 | add_install_test(EXPIRED, NOCERT, NETWORK_FAILURE); |
michael@0 | 240 | add_install_test(EXPIRED, SELFSIGNED, NETWORK_FAILURE); |
michael@0 | 241 | add_install_test(EXPIRED, UNTRUSTED, NETWORK_FAILURE); |
michael@0 | 242 | add_install_test(EXPIRED, EXPIRED, NETWORK_FAILURE); |
michael@0 | 243 | |
michael@0 | 244 | run_install_tests(run_next_test); |
michael@0 | 245 | }); |
michael@0 | 246 | |
michael@0 | 247 | // Runs tests with built-in certificates required, all certificate exceptions |
michael@0 | 248 | // and no hashes |
michael@0 | 249 | add_test(function() { |
michael@0 | 250 | Services.prefs.clearUserPref(PREF_INSTALL_REQUIREBUILTINCERTS); |
michael@0 | 251 | addCertOverrides(); |
michael@0 | 252 | |
michael@0 | 253 | // Tests that a simple install works as expected. |
michael@0 | 254 | add_install_test(HTTP, null, SUCCESS); |
michael@0 | 255 | add_install_test(HTTPS, null, NETWORK_FAILURE); |
michael@0 | 256 | add_install_test(NOCERT, null, NETWORK_FAILURE); |
michael@0 | 257 | add_install_test(SELFSIGNED, null, NETWORK_FAILURE); |
michael@0 | 258 | add_install_test(UNTRUSTED, null, NETWORK_FAILURE); |
michael@0 | 259 | add_install_test(EXPIRED, null, NETWORK_FAILURE); |
michael@0 | 260 | |
michael@0 | 261 | // Tests that redirecting from http to other servers works as expected |
michael@0 | 262 | add_install_test(HTTP, HTTP, SUCCESS); |
michael@0 | 263 | add_install_test(HTTP, HTTPS, SUCCESS); |
michael@0 | 264 | add_install_test(HTTP, NOCERT, SUCCESS); |
michael@0 | 265 | add_install_test(HTTP, SELFSIGNED, SUCCESS); |
michael@0 | 266 | add_install_test(HTTP, UNTRUSTED, SUCCESS); |
michael@0 | 267 | add_install_test(HTTP, EXPIRED, SUCCESS); |
michael@0 | 268 | |
michael@0 | 269 | // Tests that redirecting from valid https to other servers works as expected |
michael@0 | 270 | add_install_test(HTTPS, HTTP, NETWORK_FAILURE); |
michael@0 | 271 | add_install_test(HTTPS, HTTPS, NETWORK_FAILURE); |
michael@0 | 272 | add_install_test(HTTPS, NOCERT, NETWORK_FAILURE); |
michael@0 | 273 | add_install_test(HTTPS, SELFSIGNED, NETWORK_FAILURE); |
michael@0 | 274 | add_install_test(HTTPS, UNTRUSTED, NETWORK_FAILURE); |
michael@0 | 275 | add_install_test(HTTPS, EXPIRED, NETWORK_FAILURE); |
michael@0 | 276 | |
michael@0 | 277 | // Tests that redirecting from nocert https to other servers works as expected |
michael@0 | 278 | add_install_test(NOCERT, HTTP, NETWORK_FAILURE); |
michael@0 | 279 | add_install_test(NOCERT, HTTPS, NETWORK_FAILURE); |
michael@0 | 280 | add_install_test(NOCERT, NOCERT, NETWORK_FAILURE); |
michael@0 | 281 | add_install_test(NOCERT, SELFSIGNED, NETWORK_FAILURE); |
michael@0 | 282 | add_install_test(NOCERT, UNTRUSTED, NETWORK_FAILURE); |
michael@0 | 283 | add_install_test(NOCERT, EXPIRED, NETWORK_FAILURE); |
michael@0 | 284 | |
michael@0 | 285 | // Tests that redirecting from self-signed https to other servers works as expected |
michael@0 | 286 | add_install_test(SELFSIGNED, HTTP, NETWORK_FAILURE); |
michael@0 | 287 | add_install_test(SELFSIGNED, HTTPS, NETWORK_FAILURE); |
michael@0 | 288 | add_install_test(SELFSIGNED, NOCERT, NETWORK_FAILURE); |
michael@0 | 289 | add_install_test(SELFSIGNED, SELFSIGNED, NETWORK_FAILURE); |
michael@0 | 290 | add_install_test(SELFSIGNED, UNTRUSTED, NETWORK_FAILURE); |
michael@0 | 291 | add_install_test(SELFSIGNED, EXPIRED, NETWORK_FAILURE); |
michael@0 | 292 | |
michael@0 | 293 | // Tests that redirecting from untrusted https to other servers works as expected |
michael@0 | 294 | add_install_test(UNTRUSTED, HTTP, NETWORK_FAILURE); |
michael@0 | 295 | add_install_test(UNTRUSTED, HTTPS, NETWORK_FAILURE); |
michael@0 | 296 | add_install_test(UNTRUSTED, NOCERT, NETWORK_FAILURE); |
michael@0 | 297 | add_install_test(UNTRUSTED, SELFSIGNED, NETWORK_FAILURE); |
michael@0 | 298 | add_install_test(UNTRUSTED, UNTRUSTED, NETWORK_FAILURE); |
michael@0 | 299 | add_install_test(UNTRUSTED, EXPIRED, NETWORK_FAILURE); |
michael@0 | 300 | |
michael@0 | 301 | // Tests that redirecting from expired https to other servers works as expected |
michael@0 | 302 | add_install_test(EXPIRED, HTTP, NETWORK_FAILURE); |
michael@0 | 303 | add_install_test(EXPIRED, HTTPS, NETWORK_FAILURE); |
michael@0 | 304 | add_install_test(EXPIRED, NOCERT, NETWORK_FAILURE); |
michael@0 | 305 | add_install_test(EXPIRED, SELFSIGNED, NETWORK_FAILURE); |
michael@0 | 306 | add_install_test(EXPIRED, UNTRUSTED, NETWORK_FAILURE); |
michael@0 | 307 | add_install_test(EXPIRED, EXPIRED, NETWORK_FAILURE); |
michael@0 | 308 | |
michael@0 | 309 | run_install_tests(run_next_test); |
michael@0 | 310 | }); |
michael@0 | 311 | |
michael@0 | 312 | // Runs tests without requiring built-in certificates, all certificate |
michael@0 | 313 | // exceptions and no hashes |
michael@0 | 314 | add_test(function() { |
michael@0 | 315 | Services.prefs.setBoolPref(PREF_INSTALL_REQUIREBUILTINCERTS, false); |
michael@0 | 316 | |
michael@0 | 317 | // Tests that a simple install works as expected. |
michael@0 | 318 | add_install_test(HTTP, null, SUCCESS); |
michael@0 | 319 | add_install_test(HTTPS, null, SUCCESS); |
michael@0 | 320 | add_install_test(NOCERT, null, SUCCESS); |
michael@0 | 321 | add_install_test(SELFSIGNED, null, SUCCESS); |
michael@0 | 322 | add_install_test(UNTRUSTED, null, SUCCESS); |
michael@0 | 323 | add_install_test(EXPIRED, null, SUCCESS); |
michael@0 | 324 | |
michael@0 | 325 | // Tests that redirecting from http to other servers works as expected |
michael@0 | 326 | add_install_test(HTTP, HTTP, SUCCESS); |
michael@0 | 327 | add_install_test(HTTP, HTTPS, SUCCESS); |
michael@0 | 328 | add_install_test(HTTP, NOCERT, SUCCESS); |
michael@0 | 329 | add_install_test(HTTP, SELFSIGNED, SUCCESS); |
michael@0 | 330 | add_install_test(HTTP, UNTRUSTED, SUCCESS); |
michael@0 | 331 | add_install_test(HTTP, EXPIRED, SUCCESS); |
michael@0 | 332 | |
michael@0 | 333 | // Tests that redirecting from valid https to other servers works as expected |
michael@0 | 334 | add_install_test(HTTPS, HTTP, NETWORK_FAILURE); |
michael@0 | 335 | add_install_test(HTTPS, HTTPS, SUCCESS); |
michael@0 | 336 | add_install_test(HTTPS, NOCERT, SUCCESS); |
michael@0 | 337 | add_install_test(HTTPS, SELFSIGNED, SUCCESS); |
michael@0 | 338 | add_install_test(HTTPS, UNTRUSTED, SUCCESS); |
michael@0 | 339 | add_install_test(HTTPS, EXPIRED, SUCCESS); |
michael@0 | 340 | |
michael@0 | 341 | // Tests that redirecting from nocert https to other servers works as expected |
michael@0 | 342 | add_install_test(NOCERT, HTTP, NETWORK_FAILURE); |
michael@0 | 343 | add_install_test(NOCERT, HTTPS, SUCCESS); |
michael@0 | 344 | add_install_test(NOCERT, NOCERT, SUCCESS); |
michael@0 | 345 | add_install_test(NOCERT, SELFSIGNED, SUCCESS); |
michael@0 | 346 | add_install_test(NOCERT, UNTRUSTED, SUCCESS); |
michael@0 | 347 | add_install_test(NOCERT, EXPIRED, SUCCESS); |
michael@0 | 348 | |
michael@0 | 349 | // Tests that redirecting from self-signed https to other servers works as expected |
michael@0 | 350 | add_install_test(SELFSIGNED, HTTP, NETWORK_FAILURE); |
michael@0 | 351 | add_install_test(SELFSIGNED, HTTPS, SUCCESS); |
michael@0 | 352 | add_install_test(SELFSIGNED, NOCERT, SUCCESS); |
michael@0 | 353 | add_install_test(SELFSIGNED, SELFSIGNED, SUCCESS); |
michael@0 | 354 | add_install_test(SELFSIGNED, UNTRUSTED, SUCCESS); |
michael@0 | 355 | add_install_test(SELFSIGNED, EXPIRED, SUCCESS); |
michael@0 | 356 | |
michael@0 | 357 | // Tests that redirecting from untrusted https to other servers works as expected |
michael@0 | 358 | add_install_test(UNTRUSTED, HTTP, NETWORK_FAILURE); |
michael@0 | 359 | add_install_test(UNTRUSTED, HTTPS, SUCCESS); |
michael@0 | 360 | add_install_test(UNTRUSTED, NOCERT, SUCCESS); |
michael@0 | 361 | add_install_test(UNTRUSTED, SELFSIGNED, SUCCESS); |
michael@0 | 362 | add_install_test(UNTRUSTED, UNTRUSTED, SUCCESS); |
michael@0 | 363 | add_install_test(UNTRUSTED, EXPIRED, SUCCESS); |
michael@0 | 364 | |
michael@0 | 365 | // Tests that redirecting from expired https to other servers works as expected |
michael@0 | 366 | add_install_test(EXPIRED, HTTP, NETWORK_FAILURE); |
michael@0 | 367 | add_install_test(EXPIRED, HTTPS, SUCCESS); |
michael@0 | 368 | add_install_test(EXPIRED, NOCERT, SUCCESS); |
michael@0 | 369 | add_install_test(EXPIRED, SELFSIGNED, SUCCESS); |
michael@0 | 370 | add_install_test(EXPIRED, UNTRUSTED, SUCCESS); |
michael@0 | 371 | add_install_test(EXPIRED, EXPIRED, SUCCESS); |
michael@0 | 372 | |
michael@0 | 373 | run_install_tests(run_next_test); |
michael@0 | 374 | }); |