docs: function browsersForPlatform(config, cb) {
    const { platform } = process;
    let tempDir = os.tmpdir();
    let userHomeDir = process.env.HOME || process.env.USERPROFILE;
    if (config.user_data_dir) {
      tempDir = path.resolve(config.cwd, config.user_data_dir);
      userHomeDir = tempDir;
    }
  
    if (platform === 'win32') {
      cb([{
        name: 'IE',
        exe: ':\\Program Files\\Internet Explorer\\iexplore.exe',
        supported: browserExeExists
      }, {
        name: 'Firefox',
        exe: [
          'C:\\Program Files\\Mozilla Firefox\\firefox.exe',
          'C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe'
        ],
        args: ['-profile', tempDir + '\\testem.firefox'],
        setup: function(config, done) {
          setupFirefoxProfile(`${tempDir}/testem.firefox`, done);
        },
        supported: browserExeExists
      }, {
        name: 'Chrome',
        exe: [
          `${userHomeDir}\\Local Settings\\Application Data\\Google\\Chrome\\Application\\chrome.exe`,
          `${userHomeDir}\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe`,
          'C:\\Program Files\\Google\\Chrome\\Application\\Chrome.exe',
          'C:\\Program Files (x86)\\Google\\Chrome\\Application\\Chrome.exe'
        ],
        args: [`--user-data-dir=${tempDir}\\testem.chrome`, '--no-default-browser-check', '--no-first-run', '--ignore-certificate-errors', '--test-type'],
        setup: function(config, done) {
          rimraf(`${tempDir}\\testem.chrome`, done);
        },
        supported: browserExeExists
      }, {
        name: 'Safari',
        exe: [
          'C:\\Program Files\\Safari\\safari.exe',
          'C:\\Program Files (x86)\\Safari\\safari.exe'
        ],
        supported: browserExeExists
      }, {
        name: 'Opera',
        exe: [
          'C:\\Program Files\\Opera\\opera.exe',
          'C:\\Program Files (x86)\\Opera\\opera.exe'
        ],
        args: [`--user-data-dir=${tempDir}\\testem.opera`, '-pd', `${tempDir}\\testem.opera`],
        setup: function(config, done) {
          rimraf(`${tempDir}\\testem.opera`, done);
        },
        supported: browserExeExists
      }, {
        name: 'PhantomJS',
        exe: 'phantomjs',
        useCrossSpawn: true,
        args: buildPhantomJsArgs,
        supported: findableByWhereOrModule
      }]);
    } else if (platform === 'darwin') {
      cb([{
        name: 'Chrome',
        exe: [
          process.env.HOME + '/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome',
          '/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome'
        ],
        args: [`--user-data-dir=${tempDir}/testem.chrome`, '--no-default-browser-check', '--no-first-run', '--ignore-certificate-errors', '--test-type'],
        setup: function(config, done) {
          rimraf(`${tempDir}/testem.chrome`, done);
        },
        supported: browserExeExists
      }, {
        name: 'Chrome Canary',
        exe: [
          process.env.HOME + '/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary',
          '/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary'
        ],
        args: [`--user-data-dir=${tempDir}/testem.chrome-canary`, '--no-default-browser-check', '--no-first-run', '--ignore-certificate-errors', '--test-type'],
        setup: function(config, done) {
          rimraf(`${tempDir}/testem.chrome-canary`, done);
        },
        supported: browserExeExists
      }, {
        name: 'Firefox',
        exe: [
          process.env.HOME + '/Applications/Firefox.app/Contents/MacOS/firefox',
          '/Applications/Firefox.app/Contents/MacOS/firefox'
        ],
        args: ['-profile', `${tempDir}/testem.firefox`],
        setup: function(config, done) {
          setupFirefoxProfile(`${tempDir}/testem.firefox`, done);
        },
        supported: browserExeExists
      }, {
        name: 'Safari',
        exe: [
          process.env.HOME + '/Applications/Safari.app/Contents/MacOS/Safari',
          '/Applications/Safari.app/Contents/MacOS/Safari'
        ],
        setup: function(config, done) {
          const url = this.getUrl();
          fs.writeFile(`${tempDir}/testem.safari.html`, '<script>window.location = \'' + url + '\'</script>', done);
        },
        args: function() {
          return [`${tempDir}/testem.safari.html`];
        },
        supported: browserExeExists
      }, {
        name: 'Opera',
        exe: [
          process.env.HOME + '/Applications/Opera.app/Contents/MacOS/Opera',
          '/Applications/Opera.app/Contents/MacOS/Opera'
        ],
        args: [`--user-data-dir=${tempDir}/testem.opera`, '-pd', `${tempDir}/testem.opera`],
        setup: function(config, done) {
          rimraf(`${tempDir}/testem.opera`, done);
        },
        supported: browserExeExists
      }, {
        name: 'PhantomJS',
        exe: 'phantomjs',
        args: buildPhantomJsArgs,
        supported: findableByWhichOrModule
      }]);
    } else if (platform === 'linux') {
      const browsers = [{
        name: 'Firefox',
        exe: 'firefox',
        args: ['-no-remote', '-profile', `${tempDir}/testem.firefox`],
        setup: function(config, done) {
          setupFirefoxProfile(`${tempDir}/testem.firefox`, done);
        },
        supported: findableByWhich
      }, {
        name: 'Chrome',
        exe: 'google-chrome',
        args: [
          `--user-data-dir=${tempDir}/testem.chrome`,
          '--no-default-browser-check',
          '--no-first-run',
          '--ignore-certificate-errors'
        ],
        setup: function(config, done) {
          rimraf(`${tempDir}/testem.chrome`, done);
        },
        supported: findableByWhich
      }, {
        name: 'Chromium',
        exe: ['chromium', 'chromium-browser'],
        args: [
          `--user-data-dir=${tempDir}/testem.chromium`,
          '--no-default-browser-check',
          '--no-first-run',
          '--ignore-certificate-errors'
        ],
        setup: function(config, done) {
          rimraf(`${tempDir}/testem.chromium`, done);
        },
        supported: findableByWhich
      }, {
        name: 'PhantomJS',
        exe: 'phantomjs',
        args: buildPhantomJsArgs,
        supported: findableByWhichOrModule
      }];
  
      // If dbus-launch is present, wrap google-chrome launch
      // to prevent a race condition in Google Chrome
      // Discussion here: https://github.com/angular/protractor/issues/2419
      // Adds a second set of wrapper browsers that will override the previous set of browsers
      // if dbus-launch is available.
      const dbus = {
        exe: 'dbus-launch',
        supported: findableByWhich
      };
      dbus.supported(function(dbusAvailable) {
        if (dbusAvailable) {
          // Make sure the original browser was supported.
          async.filter(browsers, function(browser, cb) {
            browser.supported(cb);
          }, function(available) {
            available.forEach(function(browser) {
              if (browser.name !== 'PhantomJS') {
                browser.args.unshift('--exit-with-session', browser.exe);
                browser.exe = dbus.exe;
              }
            });
            cb(available);
          });
        } else {
          cb(browsers);
        }
      });
    } else if (platform === 'sunos') {
      cb([{
        name: 'PhantomJS',
        exe: 'phantomjs',
        args: buildPhantomJsArgs,
        supported: findableByWhichOrModule
      }]);
    } else if (platform === 'freebsd') {
      cb([{
        name: 'PhantomJS',
        exe: 'phantomjs',
        args: buildPhantomJsArgs,
        supported: findableByWhichOrModule
      }]);
    } else {
      cb([]);
    }
  }