toolkit/mozapps/extensions/test/browser/browser_updatessl.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

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 let tempScope = {};
michael@0 6 Components.utils.import("resource://gre/modules/addons/AddonUpdateChecker.jsm", tempScope);
michael@0 7 let AddonUpdateChecker = tempScope.AddonUpdateChecker;
michael@0 8
michael@0 9 const updaterdf = RELATIVE_DIR + "browser_updatessl.rdf";
michael@0 10 const redirect = RELATIVE_DIR + "redirect.sjs?";
michael@0 11 const SUCCESS = 0;
michael@0 12 const DOWNLOAD_ERROR = AddonUpdateChecker.ERROR_DOWNLOAD_ERROR;
michael@0 13
michael@0 14 const HTTP = "http://example.com/";
michael@0 15 const HTTPS = "https://example.com/";
michael@0 16 const NOCERT = "https://nocert.example.com/";
michael@0 17 const SELFSIGNED = "https://self-signed.example.com/";
michael@0 18 const UNTRUSTED = "https://untrusted.example.com/";
michael@0 19 const EXPIRED = "https://expired.example.com/";
michael@0 20
michael@0 21 const PREF_UPDATE_REQUIREBUILTINCERTS = "extensions.update.requireBuiltInCerts";
michael@0 22
michael@0 23 var gTests = [];
michael@0 24 var gStart = 0;
michael@0 25 var gLast = 0;
michael@0 26
michael@0 27 var HTTPObserver = {
michael@0 28 observeActivity: function(aChannel, aType, aSubtype, aTimestamp, aSizeData,
michael@0 29 aStringData) {
michael@0 30 aChannel.QueryInterface(Ci.nsIChannel);
michael@0 31
michael@0 32 dump("*** HTTP Activity 0x" + aType.toString(16) + " 0x" + aSubtype.toString(16) +
michael@0 33 " " + aChannel.URI.spec + "\n");
michael@0 34 }
michael@0 35 };
michael@0 36
michael@0 37 function test() {
michael@0 38 gStart = Date.now();
michael@0 39 requestLongerTimeout(4);
michael@0 40 waitForExplicitFinish();
michael@0 41
michael@0 42 let observerService = Cc["@mozilla.org/network/http-activity-distributor;1"].
michael@0 43 getService(Ci.nsIHttpActivityDistributor);
michael@0 44 observerService.addObserver(HTTPObserver);
michael@0 45
michael@0 46 registerCleanupFunction(function() {
michael@0 47 observerService.removeObserver(HTTPObserver);
michael@0 48 });
michael@0 49
michael@0 50 run_next_test();
michael@0 51 }
michael@0 52
michael@0 53 function end_test() {
michael@0 54 Services.prefs.clearUserPref(PREF_UPDATE_REQUIREBUILTINCERTS);
michael@0 55
michael@0 56 var cos = Cc["@mozilla.org/security/certoverride;1"].
michael@0 57 getService(Ci.nsICertOverrideService);
michael@0 58 cos.clearValidityOverride("nocert.example.com", -1);
michael@0 59 cos.clearValidityOverride("self-signed.example.com", -1);
michael@0 60 cos.clearValidityOverride("untrusted.example.com", -1);
michael@0 61 cos.clearValidityOverride("expired.example.com", -1);
michael@0 62
michael@0 63 info("All tests completed in " + (Date.now() - gStart) + "ms");
michael@0 64 finish();
michael@0 65 }
michael@0 66
michael@0 67 function add_update_test(mainURL, redirectURL, expectedStatus) {
michael@0 68 gTests.push([mainURL, redirectURL, expectedStatus]);
michael@0 69 }
michael@0 70
michael@0 71 function run_update_tests(callback) {
michael@0 72 function run_next_update_test() {
michael@0 73 if (gTests.length == 0) {
michael@0 74 callback();
michael@0 75 return;
michael@0 76 }
michael@0 77 gLast = Date.now();
michael@0 78
michael@0 79 let [mainURL, redirectURL, expectedStatus] = gTests.shift();
michael@0 80 if (redirectURL) {
michael@0 81 var url = mainURL + redirect + redirectURL + updaterdf;
michael@0 82 var message = "Should have seen the right result for an update check redirected from " +
michael@0 83 mainURL + " to " + redirectURL;
michael@0 84 }
michael@0 85 else {
michael@0 86 url = mainURL + updaterdf;
michael@0 87 message = "Should have seen the right result for an update check from " +
michael@0 88 mainURL;
michael@0 89 }
michael@0 90
michael@0 91 AddonUpdateChecker.checkForUpdates("addon1@tests.mozilla.org",
michael@0 92 null, url, {
michael@0 93 onUpdateCheckComplete: function(updates) {
michael@0 94 is(updates.length, 1, "Should be the right number of results");
michael@0 95 is(SUCCESS, expectedStatus, message);
michael@0 96 info("Update test ran in " + (Date.now() - gLast) + "ms");
michael@0 97 run_next_update_test();
michael@0 98 },
michael@0 99
michael@0 100 onUpdateCheckError: function(status) {
michael@0 101 is(status, expectedStatus, message);
michael@0 102 info("Update test ran in " + (Date.now() - gLast) + "ms");
michael@0 103 run_next_update_test();
michael@0 104 }
michael@0 105 });
michael@0 106 }
michael@0 107
michael@0 108 run_next_update_test();
michael@0 109 }
michael@0 110
michael@0 111 // Add overrides for the bad certificates
michael@0 112 function addCertOverrides() {
michael@0 113 addCertOverride("nocert.example.com", Ci.nsICertOverrideService.ERROR_MISMATCH);
michael@0 114 addCertOverride("self-signed.example.com", Ci.nsICertOverrideService.ERROR_UNTRUSTED);
michael@0 115 addCertOverride("untrusted.example.com", Ci.nsICertOverrideService.ERROR_UNTRUSTED);
michael@0 116 addCertOverride("expired.example.com", Ci.nsICertOverrideService.ERROR_TIME);
michael@0 117 }
michael@0 118
michael@0 119 // Runs tests with built-in certificates required and no certificate exceptions.
michael@0 120 add_test(function() {
michael@0 121 // Tests that a simple update.rdf retrieval works as expected.
michael@0 122 add_update_test(HTTP, null, SUCCESS);
michael@0 123 add_update_test(HTTPS, null, DOWNLOAD_ERROR);
michael@0 124 add_update_test(NOCERT, null, DOWNLOAD_ERROR);
michael@0 125 add_update_test(SELFSIGNED, null, DOWNLOAD_ERROR);
michael@0 126 add_update_test(UNTRUSTED, null, DOWNLOAD_ERROR);
michael@0 127 add_update_test(EXPIRED, null, DOWNLOAD_ERROR);
michael@0 128
michael@0 129 // Tests that redirecting from http to other servers works as expected
michael@0 130 add_update_test(HTTP, HTTP, SUCCESS);
michael@0 131 add_update_test(HTTP, HTTPS, SUCCESS);
michael@0 132 add_update_test(HTTP, NOCERT, DOWNLOAD_ERROR);
michael@0 133 add_update_test(HTTP, SELFSIGNED, DOWNLOAD_ERROR);
michael@0 134 add_update_test(HTTP, UNTRUSTED, DOWNLOAD_ERROR);
michael@0 135 add_update_test(HTTP, EXPIRED, DOWNLOAD_ERROR);
michael@0 136
michael@0 137 // Tests that redirecting from valid https to other servers works as expected
michael@0 138 add_update_test(HTTPS, HTTP, DOWNLOAD_ERROR);
michael@0 139 add_update_test(HTTPS, HTTPS, DOWNLOAD_ERROR);
michael@0 140 add_update_test(HTTPS, NOCERT, DOWNLOAD_ERROR);
michael@0 141 add_update_test(HTTPS, SELFSIGNED, DOWNLOAD_ERROR);
michael@0 142 add_update_test(HTTPS, UNTRUSTED, DOWNLOAD_ERROR);
michael@0 143 add_update_test(HTTPS, EXPIRED, DOWNLOAD_ERROR);
michael@0 144
michael@0 145 // Tests that redirecting from nocert https to other servers works as expected
michael@0 146 add_update_test(NOCERT, HTTP, DOWNLOAD_ERROR);
michael@0 147 add_update_test(NOCERT, HTTPS, DOWNLOAD_ERROR);
michael@0 148 add_update_test(NOCERT, NOCERT, DOWNLOAD_ERROR);
michael@0 149 add_update_test(NOCERT, SELFSIGNED, DOWNLOAD_ERROR);
michael@0 150 add_update_test(NOCERT, UNTRUSTED, DOWNLOAD_ERROR);
michael@0 151 add_update_test(NOCERT, EXPIRED, DOWNLOAD_ERROR);
michael@0 152
michael@0 153 // Tests that redirecting from self-signed https to other servers works as expected
michael@0 154 add_update_test(SELFSIGNED, HTTP, DOWNLOAD_ERROR);
michael@0 155 add_update_test(SELFSIGNED, HTTPS, DOWNLOAD_ERROR);
michael@0 156 add_update_test(SELFSIGNED, NOCERT, DOWNLOAD_ERROR);
michael@0 157 add_update_test(SELFSIGNED, SELFSIGNED, DOWNLOAD_ERROR);
michael@0 158 add_update_test(SELFSIGNED, UNTRUSTED, DOWNLOAD_ERROR);
michael@0 159 add_update_test(SELFSIGNED, EXPIRED, DOWNLOAD_ERROR);
michael@0 160
michael@0 161 // Tests that redirecting from untrusted https to other servers works as expected
michael@0 162 add_update_test(UNTRUSTED, HTTP, DOWNLOAD_ERROR);
michael@0 163 add_update_test(UNTRUSTED, HTTPS, DOWNLOAD_ERROR);
michael@0 164 add_update_test(UNTRUSTED, NOCERT, DOWNLOAD_ERROR);
michael@0 165 add_update_test(UNTRUSTED, SELFSIGNED, DOWNLOAD_ERROR);
michael@0 166 add_update_test(UNTRUSTED, UNTRUSTED, DOWNLOAD_ERROR);
michael@0 167 add_update_test(UNTRUSTED, EXPIRED, DOWNLOAD_ERROR);
michael@0 168
michael@0 169 // Tests that redirecting from expired https to other servers works as expected
michael@0 170 add_update_test(EXPIRED, HTTP, DOWNLOAD_ERROR);
michael@0 171 add_update_test(EXPIRED, HTTPS, DOWNLOAD_ERROR);
michael@0 172 add_update_test(EXPIRED, NOCERT, DOWNLOAD_ERROR);
michael@0 173 add_update_test(EXPIRED, SELFSIGNED, DOWNLOAD_ERROR);
michael@0 174 add_update_test(EXPIRED, UNTRUSTED, DOWNLOAD_ERROR);
michael@0 175 add_update_test(EXPIRED, EXPIRED, DOWNLOAD_ERROR);
michael@0 176
michael@0 177 run_update_tests(run_next_test);
michael@0 178 });
michael@0 179
michael@0 180 // Runs tests without requiring built-in certificates and no certificate
michael@0 181 // exceptions.
michael@0 182 add_test(function() {
michael@0 183 Services.prefs.setBoolPref(PREF_UPDATE_REQUIREBUILTINCERTS, false);
michael@0 184
michael@0 185 // Tests that a simple update.rdf retrieval works as expected.
michael@0 186 add_update_test(HTTP, null, SUCCESS);
michael@0 187 add_update_test(HTTPS, null, SUCCESS);
michael@0 188 add_update_test(NOCERT, null, DOWNLOAD_ERROR);
michael@0 189 add_update_test(SELFSIGNED, null, DOWNLOAD_ERROR);
michael@0 190 add_update_test(UNTRUSTED, null, DOWNLOAD_ERROR);
michael@0 191 add_update_test(EXPIRED, null, DOWNLOAD_ERROR);
michael@0 192
michael@0 193 // Tests that redirecting from http to other servers works as expected
michael@0 194 add_update_test(HTTP, HTTP, SUCCESS);
michael@0 195 add_update_test(HTTP, HTTPS, SUCCESS);
michael@0 196 add_update_test(HTTP, NOCERT, DOWNLOAD_ERROR);
michael@0 197 add_update_test(HTTP, SELFSIGNED, DOWNLOAD_ERROR);
michael@0 198 add_update_test(HTTP, UNTRUSTED, DOWNLOAD_ERROR);
michael@0 199 add_update_test(HTTP, EXPIRED, DOWNLOAD_ERROR);
michael@0 200
michael@0 201 // Tests that redirecting from valid https to other servers works as expected
michael@0 202 add_update_test(HTTPS, HTTP, DOWNLOAD_ERROR);
michael@0 203 add_update_test(HTTPS, HTTPS, SUCCESS);
michael@0 204 add_update_test(HTTPS, NOCERT, DOWNLOAD_ERROR);
michael@0 205 add_update_test(HTTPS, SELFSIGNED, DOWNLOAD_ERROR);
michael@0 206 add_update_test(HTTPS, UNTRUSTED, DOWNLOAD_ERROR);
michael@0 207 add_update_test(HTTPS, EXPIRED, DOWNLOAD_ERROR);
michael@0 208
michael@0 209 // Tests that redirecting from nocert https to other servers works as expected
michael@0 210 add_update_test(NOCERT, HTTP, DOWNLOAD_ERROR);
michael@0 211 add_update_test(NOCERT, HTTPS, DOWNLOAD_ERROR);
michael@0 212 add_update_test(NOCERT, NOCERT, DOWNLOAD_ERROR);
michael@0 213 add_update_test(NOCERT, SELFSIGNED, DOWNLOAD_ERROR);
michael@0 214 add_update_test(NOCERT, UNTRUSTED, DOWNLOAD_ERROR);
michael@0 215 add_update_test(NOCERT, EXPIRED, DOWNLOAD_ERROR);
michael@0 216
michael@0 217 // Tests that redirecting from self-signed https to other servers works as expected
michael@0 218 add_update_test(SELFSIGNED, HTTP, DOWNLOAD_ERROR);
michael@0 219 add_update_test(SELFSIGNED, HTTPS, DOWNLOAD_ERROR);
michael@0 220 add_update_test(SELFSIGNED, NOCERT, DOWNLOAD_ERROR);
michael@0 221 add_update_test(SELFSIGNED, SELFSIGNED, DOWNLOAD_ERROR);
michael@0 222 add_update_test(SELFSIGNED, UNTRUSTED, DOWNLOAD_ERROR);
michael@0 223 add_update_test(SELFSIGNED, EXPIRED, DOWNLOAD_ERROR);
michael@0 224
michael@0 225 // Tests that redirecting from untrusted https to other servers works as expected
michael@0 226 add_update_test(UNTRUSTED, HTTP, DOWNLOAD_ERROR);
michael@0 227 add_update_test(UNTRUSTED, HTTPS, DOWNLOAD_ERROR);
michael@0 228 add_update_test(UNTRUSTED, NOCERT, DOWNLOAD_ERROR);
michael@0 229 add_update_test(UNTRUSTED, SELFSIGNED, DOWNLOAD_ERROR);
michael@0 230 add_update_test(UNTRUSTED, UNTRUSTED, DOWNLOAD_ERROR);
michael@0 231 add_update_test(UNTRUSTED, EXPIRED, DOWNLOAD_ERROR);
michael@0 232
michael@0 233 // Tests that redirecting from expired https to other servers works as expected
michael@0 234 add_update_test(EXPIRED, HTTP, DOWNLOAD_ERROR);
michael@0 235 add_update_test(EXPIRED, HTTPS, DOWNLOAD_ERROR);
michael@0 236 add_update_test(EXPIRED, NOCERT, DOWNLOAD_ERROR);
michael@0 237 add_update_test(EXPIRED, SELFSIGNED, DOWNLOAD_ERROR);
michael@0 238 add_update_test(EXPIRED, UNTRUSTED, DOWNLOAD_ERROR);
michael@0 239 add_update_test(EXPIRED, EXPIRED, DOWNLOAD_ERROR);
michael@0 240
michael@0 241 run_update_tests(run_next_test);
michael@0 242 });
michael@0 243
michael@0 244 // Runs tests with built-in certificates required and all certificate exceptions.
michael@0 245 add_test(function() {
michael@0 246 Services.prefs.clearUserPref(PREF_UPDATE_REQUIREBUILTINCERTS);
michael@0 247 addCertOverrides();
michael@0 248
michael@0 249 // Tests that a simple update.rdf retrieval works as expected.
michael@0 250 add_update_test(HTTP, null, SUCCESS);
michael@0 251 add_update_test(HTTPS, null, DOWNLOAD_ERROR);
michael@0 252 add_update_test(NOCERT, null, DOWNLOAD_ERROR);
michael@0 253 add_update_test(SELFSIGNED, null, DOWNLOAD_ERROR);
michael@0 254 add_update_test(UNTRUSTED, null, DOWNLOAD_ERROR);
michael@0 255 add_update_test(EXPIRED, null, DOWNLOAD_ERROR);
michael@0 256
michael@0 257 // Tests that redirecting from http to other servers works as expected
michael@0 258 add_update_test(HTTP, HTTP, SUCCESS);
michael@0 259 add_update_test(HTTP, HTTPS, SUCCESS);
michael@0 260 add_update_test(HTTP, NOCERT, SUCCESS);
michael@0 261 add_update_test(HTTP, SELFSIGNED, SUCCESS);
michael@0 262 add_update_test(HTTP, UNTRUSTED, SUCCESS);
michael@0 263 add_update_test(HTTP, EXPIRED, SUCCESS);
michael@0 264
michael@0 265 // Tests that redirecting from valid https to other servers works as expected
michael@0 266 add_update_test(HTTPS, HTTP, DOWNLOAD_ERROR);
michael@0 267 add_update_test(HTTPS, HTTPS, DOWNLOAD_ERROR);
michael@0 268 add_update_test(HTTPS, NOCERT, DOWNLOAD_ERROR);
michael@0 269 add_update_test(HTTPS, SELFSIGNED, DOWNLOAD_ERROR);
michael@0 270 add_update_test(HTTPS, UNTRUSTED, DOWNLOAD_ERROR);
michael@0 271 add_update_test(HTTPS, EXPIRED, DOWNLOAD_ERROR);
michael@0 272
michael@0 273 // Tests that redirecting from nocert https to other servers works as expected
michael@0 274 add_update_test(NOCERT, HTTP, DOWNLOAD_ERROR);
michael@0 275 add_update_test(NOCERT, HTTPS, DOWNLOAD_ERROR);
michael@0 276 add_update_test(NOCERT, NOCERT, DOWNLOAD_ERROR);
michael@0 277 add_update_test(NOCERT, SELFSIGNED, DOWNLOAD_ERROR);
michael@0 278 add_update_test(NOCERT, UNTRUSTED, DOWNLOAD_ERROR);
michael@0 279 add_update_test(NOCERT, EXPIRED, DOWNLOAD_ERROR);
michael@0 280
michael@0 281 // Tests that redirecting from self-signed https to other servers works as expected
michael@0 282 add_update_test(SELFSIGNED, HTTP, DOWNLOAD_ERROR);
michael@0 283 add_update_test(SELFSIGNED, HTTPS, DOWNLOAD_ERROR);
michael@0 284 add_update_test(SELFSIGNED, NOCERT, DOWNLOAD_ERROR);
michael@0 285 add_update_test(SELFSIGNED, SELFSIGNED, DOWNLOAD_ERROR);
michael@0 286 add_update_test(SELFSIGNED, UNTRUSTED, DOWNLOAD_ERROR);
michael@0 287 add_update_test(SELFSIGNED, EXPIRED, DOWNLOAD_ERROR);
michael@0 288
michael@0 289 // Tests that redirecting from untrusted https to other servers works as expected
michael@0 290 add_update_test(UNTRUSTED, HTTP, DOWNLOAD_ERROR);
michael@0 291 add_update_test(UNTRUSTED, HTTPS, DOWNLOAD_ERROR);
michael@0 292 add_update_test(UNTRUSTED, NOCERT, DOWNLOAD_ERROR);
michael@0 293 add_update_test(UNTRUSTED, SELFSIGNED, DOWNLOAD_ERROR);
michael@0 294 add_update_test(UNTRUSTED, UNTRUSTED, DOWNLOAD_ERROR);
michael@0 295 add_update_test(UNTRUSTED, EXPIRED, DOWNLOAD_ERROR);
michael@0 296
michael@0 297 // Tests that redirecting from expired https to other servers works as expected
michael@0 298 add_update_test(EXPIRED, HTTP, DOWNLOAD_ERROR);
michael@0 299 add_update_test(EXPIRED, HTTPS, DOWNLOAD_ERROR);
michael@0 300 add_update_test(EXPIRED, NOCERT, DOWNLOAD_ERROR);
michael@0 301 add_update_test(EXPIRED, SELFSIGNED, DOWNLOAD_ERROR);
michael@0 302 add_update_test(EXPIRED, UNTRUSTED, DOWNLOAD_ERROR);
michael@0 303 add_update_test(EXPIRED, EXPIRED, DOWNLOAD_ERROR);
michael@0 304
michael@0 305 run_update_tests(run_next_test);
michael@0 306 });
michael@0 307
michael@0 308 // Runs tests without requiring built-in certificates and all certificate
michael@0 309 // exceptions.
michael@0 310 add_test(function() {
michael@0 311 Services.prefs.setBoolPref(PREF_UPDATE_REQUIREBUILTINCERTS, false);
michael@0 312
michael@0 313 // Tests that a simple update.rdf retrieval works as expected.
michael@0 314 add_update_test(HTTP, null, SUCCESS);
michael@0 315 add_update_test(HTTPS, null, SUCCESS);
michael@0 316 add_update_test(NOCERT, null, SUCCESS);
michael@0 317 add_update_test(SELFSIGNED, null, SUCCESS);
michael@0 318 add_update_test(UNTRUSTED, null, SUCCESS);
michael@0 319 add_update_test(EXPIRED, null, SUCCESS);
michael@0 320
michael@0 321 // Tests that redirecting from http to other servers works as expected
michael@0 322 add_update_test(HTTP, HTTP, SUCCESS);
michael@0 323 add_update_test(HTTP, HTTPS, SUCCESS);
michael@0 324 add_update_test(HTTP, NOCERT, SUCCESS);
michael@0 325 add_update_test(HTTP, SELFSIGNED, SUCCESS);
michael@0 326 add_update_test(HTTP, UNTRUSTED, SUCCESS);
michael@0 327 add_update_test(HTTP, EXPIRED, SUCCESS);
michael@0 328
michael@0 329 // Tests that redirecting from valid https to other servers works as expected
michael@0 330 add_update_test(HTTPS, HTTP, DOWNLOAD_ERROR);
michael@0 331 add_update_test(HTTPS, HTTPS, SUCCESS);
michael@0 332 add_update_test(HTTPS, NOCERT, SUCCESS);
michael@0 333 add_update_test(HTTPS, SELFSIGNED, SUCCESS);
michael@0 334 add_update_test(HTTPS, UNTRUSTED, SUCCESS);
michael@0 335 add_update_test(HTTPS, EXPIRED, SUCCESS);
michael@0 336
michael@0 337 // Tests that redirecting from nocert https to other servers works as expected
michael@0 338 add_update_test(NOCERT, HTTP, DOWNLOAD_ERROR);
michael@0 339 add_update_test(NOCERT, HTTPS, SUCCESS);
michael@0 340 add_update_test(NOCERT, NOCERT, SUCCESS);
michael@0 341 add_update_test(NOCERT, SELFSIGNED, SUCCESS);
michael@0 342 add_update_test(NOCERT, UNTRUSTED, SUCCESS);
michael@0 343 add_update_test(NOCERT, EXPIRED, SUCCESS);
michael@0 344
michael@0 345 // Tests that redirecting from self-signed https to other servers works as expected
michael@0 346 add_update_test(SELFSIGNED, HTTP, DOWNLOAD_ERROR);
michael@0 347 add_update_test(SELFSIGNED, HTTPS, SUCCESS);
michael@0 348 add_update_test(SELFSIGNED, NOCERT, SUCCESS);
michael@0 349 add_update_test(SELFSIGNED, SELFSIGNED, SUCCESS);
michael@0 350 add_update_test(SELFSIGNED, UNTRUSTED, SUCCESS);
michael@0 351 add_update_test(SELFSIGNED, EXPIRED, SUCCESS);
michael@0 352
michael@0 353 // Tests that redirecting from untrusted https to other servers works as expected
michael@0 354 add_update_test(UNTRUSTED, HTTP, DOWNLOAD_ERROR);
michael@0 355 add_update_test(UNTRUSTED, HTTPS, SUCCESS);
michael@0 356 add_update_test(UNTRUSTED, NOCERT, SUCCESS);
michael@0 357 add_update_test(UNTRUSTED, SELFSIGNED, SUCCESS);
michael@0 358 add_update_test(UNTRUSTED, UNTRUSTED, SUCCESS);
michael@0 359 add_update_test(UNTRUSTED, EXPIRED, SUCCESS);
michael@0 360
michael@0 361 // Tests that redirecting from expired https to other servers works as expected
michael@0 362 add_update_test(EXPIRED, HTTP, DOWNLOAD_ERROR);
michael@0 363 add_update_test(EXPIRED, HTTPS, SUCCESS);
michael@0 364 add_update_test(EXPIRED, NOCERT, SUCCESS);
michael@0 365 add_update_test(EXPIRED, SELFSIGNED, SUCCESS);
michael@0 366 add_update_test(EXPIRED, UNTRUSTED, SUCCESS);
michael@0 367 add_update_test(EXPIRED, EXPIRED, SUCCESS);
michael@0 368
michael@0 369 run_update_tests(run_next_test);
michael@0 370 });

mercurial