https://github.com/web-platform-tests/wpt
Revision e3a20f32ed973ef4117a5900929dd89fb6a42f5c authored by mkwst@chromium.org on 20 June 2017, 13:56:45 UTC, committed by Chromium WPT Sync on 20 June 2017, 13:56:45 UTC
WIP: Don't land yet.

Bug: 607897
Change-Id: I03bf57a24da3a7479199d04a05c4487342af20ca
Reviewed-on: https://chromium-review.googlesource.com/541439
Cr-Commit-Position: refs/heads/master@{#480805}
WPT-Export-Revision: d1f6b2dc8fa27de8df93e8b7c4e9c4b419036ef5
1 parent d39b05b
Raw File
Tip revision: e3a20f32ed973ef4117a5900929dd89fb6a42f5c authored by mkwst@chromium.org on 20 June 2017, 13:56:45 UTC
Implement `Clear-Site-Data: documents`.
Tip revision: e3a20f3
ci_stability.sh
set -e

hosts_fixup() {
    echo "travis_fold:start:hosts_fixup"
    echo "Rewriting hosts file"
    echo "## /etc/hosts ##"
    cat /etc/hosts
    sudo sed -i 's/^::1\s*localhost/::1/' /etc/hosts
    sudo sh -c 'echo "
127.0.0.1 web-platform.test
127.0.0.1 www.web-platform.test
127.0.0.1 www1.web-platform.test
127.0.0.1 www2.web-platform.test
127.0.0.1 xn--n8j6ds53lwwkrqhv28a.web-platform.test
127.0.0.1 xn--lve-6lad.web-platform.test
" >> /etc/hosts'
    echo "== /etc/hosts =="
    cat /etc/hosts
    echo "----------------"
    echo "travis_fold:end:hosts_fixup"
}

install_chrome() {
    channel=$1
    deb_archive=google-chrome-${channel}_current_amd64.deb
    wget https://dl.google.com/linux/direct/$deb_archive

    # If the environment provides an installation of Google Chrome, the
    # existing binary may take precedence over the one introduced in this
    # script. Remove any previously-existing "alternatives" prior to
    # installation in order to ensure that the new binary is installed as
    # intended.
    if sudo update-alternatives --list google-chrome; then
        sudo update-alternatives --remove-all google-chrome
    fi

    # Installation will fail in cases where the package has unmet dependencies.
    # When this occurs, attempt to use the system package manager to fetch the
    # required packages and retry.
    if ! sudo dpkg --install $deb_archive; then
      sudo apt-get install --fix-broken
      sudo dpkg --install $deb_archive
    fi
}

test_stability() {
    python check_stability.py $PRODUCT --output-bytes $((1024 * 1024 * 3))
}

main() {
    hosts_fixup
    if [ $(echo $PRODUCT | grep '^chrome:') ]; then
       install_chrome $(echo $PRODUCT | grep --only-matching '\w\+$')
    fi
    test_stability
}

main
back to top