Bug 1011503 - Remove external addresses from test_speculative_connect.js. r=mcmanus, a=test-only
authorSteve Workman <sworkman@mozilla.com>
Sat, 07 Jun 2014 10:04:51 -0700
changeset 208073 b40d5a52870b2ae05528d9798400c02fb0f94407
parent 208072 5301b6d459ae47332032e0be3ef04d404270e860
child 208074 dd7fb786a1405161f9a539e3f1fe953bd0ad22f1
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus, test-only
bugs1011503
milestone32.0a2
Bug 1011503 - Remove external addresses from test_speculative_connect.js. r=mcmanus, a=test-only
netwerk/test/unit/test_speculative_connect.js
--- a/netwerk/test/unit/test_speculative_connect.js
+++ b/netwerk/test/unit/test_speculative_connect.js
@@ -32,53 +32,28 @@ var localIPv6Literals =
       "fc00::1", "fdfe:dcba:9876:abcd:ef01:2345:6789:abcd",
       "fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
       // IPv6 Link Local fe80::/10
       "fe80::1", "fe80::abcd:ef01:2345:6789",
       "febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff"
     ];
 var localIPLiterals = localIPv4Literals.concat(localIPv6Literals);
 
-/** Example remote IP addresses
- *
- * Note: The test environment may not have external network access, so
- * resolving hostnames may not be possible. Thus, literals are used here, and
- * should be directly converted by the stub resolver to IP addresses.
- */
-var remoteIPv4Literals =
-    [ "93.184.216.119", // example.com
-      "74.125.239.130", // google.com
-      "63.245.217.105", // mozilla.org
-      "173.252.110.27"  // facebook.com
-    ];
-
-var remoteIPv6Literals =
-    [ "2607:f8b0:4005:802::1009",        // google.com
-      "2620:101:8008:5::2:1",            // mozilla.org
-      "2a03:2880:2110:df07:face:b00c::1" // facebook.com
-    ];
-
-var remoteIPLiterals = remoteIPv4Literals.concat(remoteIPv6Literals);
-
 /** Test function list and descriptions.
  */
 var testList =
     [ test_speculative_connect,
       test_hostnames_resolving_to_local_addresses,
-      test_hostnames_resolving_to_remote_addresses,
-      test_proxies_with_local_addresses,
-      test_proxies_with_remote_addresses
+      test_proxies_with_local_addresses
     ];
 
 var testDescription =
     [ "Expect pass with localhost",
       "Expect failure with resolved local IPs",
-      "Expect success with resolved remote IPs",
-      "Expect failure for proxies with local IPs",
-      "Expect success for proxies with remote IPs"
+      "Expect failure for proxies with local IPs"
     ];
 
 var testIdx = 0;
 var hostIdx = 0;
 
 
 /** TestServer
  *
@@ -245,40 +220,16 @@ function test_hostnames_resolving_to_loc
         return;
     }
     var host = localIPLiterals[hostIdx++];
     // Test another local IP address when the current one is done.
     var next = test_hostnames_resolving_to_local_addresses;
     test_hostnames_resolving_to_addresses(host, false, next);
 }
 
-/**
- * test_hostnames_resolving_to_remote_addresses
- *
- * Creates an nsISocketTransport and simulates a speculative connect request
- * for a hostname that resolves to a local IP address.
- * Runs asynchronously; on test success (i.e. failure to connect), the callback
- * will call this function again until all hostnames in the test list are done.
- *
- * Note: This test also uses an IP literal for the hostname. This should be ok,
- * as the socket layer will ask for the hostname to be resolved anyway, and DNS
- * code should return a numerical version of the address internally.
- */
-function test_hostnames_resolving_to_remote_addresses() {
-    if (hostIdx >= remoteIPLiterals.length) {
-        // No more remote IP addresses; move on.
-        next_test();
-        return;
-    }
-    var host = remoteIPLiterals[hostIdx++];
-    // Test another remote IP address when the current one is done.
-    var next = test_hostnames_resolving_to_remote_addresses;
-    test_hostnames_resolving_to_addresses(host, true, next);
-}
-
 /** test_speculative_connect_with_host_list
  *
  * Common test function for resolved proxy hosts. Takes a list of hosts, a
  * boolean to determine if the test is expected to succeed or fail, and a
  * function to call the next test case.
  */
 function test_proxies(proxyHost, expectSuccess, next) {
     do_print("Proxy: " + proxyHost);
@@ -343,40 +294,16 @@ function test_proxies_with_local_address
         return;
     }
     var host = localIPLiterals[hostIdx++];
     // Test another local IP address when the current one is done.
     var next = test_proxies_with_local_addresses;
     test_proxies(host, false, next);
 }
 
-/**
- * test_proxies_with_remote_addresses
- *
- * Creates an nsISocketTransport and simulates a speculative connect request
- * for a proxy that resolves to a local IP address.
- * Runs asynchronously; on test success (i.e. failure to connect), the callback
- * will call this function again until all proxies in the test list are done.
- *
- * Note: This test also uses an IP literal for the proxy. This should be ok,
- * as the socket layer will ask for the proxy to be resolved anyway, and DNS
- * code should return a numerical version of the address internally.
- */
-function test_proxies_with_remote_addresses() {
-    if (hostIdx >= remoteIPLiterals.length) {
-        // No more local IP addresses; move on.
-        next_test();
-        return;
-    }
-    var host = remoteIPLiterals[hostIdx++];
-    // Test another local IP address when the current one is done.
-    var next = test_proxies_with_remote_addresses;
-    test_proxies(host, true, next);
-}
-
 /** next_test
  *
  * Calls the next test in testList. Each test is responsible for calling this
  * function when its test cases are complete.
  */
 function next_test() {
     if (testIdx >= testList.length) {
         // No more tests; we're done.