#!/usr/bin/env bash
##
# Description: Download and install Google Chrome Browser (Stable release)
##
# Chrome version 50.0+ requires Selenium 3, which is used for QA INT testing.
##

installChrome()
{
  pushd /tmp &&
  sudo apt-get install libxss1 libappindicator1 libindicator7  &&
  wget --quiet https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

  #
  # Error can occur here, due to inadequate dependencies.  Therefore it's exit status
  # is not being used.
  #
  # However, those broken dependencies that are identified are addressed with the following
  #   "apt-get install -f"
  #
  sudo dpkg -i google-chrome-stable_current_amd64.deb

  sudo apt-get install -f &&
  sudo dpkg -i google-chrome-stable_current_amd64.deb  &&
  sudo apt-get install xvfb  &&

  popd

  export DISPLAY=:99 &&
  Xvfb &
}



installChrome
