diff options
Diffstat (limited to 'chromium/third_party/google-closure-library/scripts')
16 files changed, 653 insertions, 0 deletions
diff --git a/chromium/third_party/google-closure-library/scripts/ci/CloseAdobeDialog.exe b/chromium/third_party/google-closure-library/scripts/ci/CloseAdobeDialog.exe Binary files differnew file mode 100755 index 00000000000..1be108d774c --- /dev/null +++ b/chromium/third_party/google-closure-library/scripts/ci/CloseAdobeDialog.exe diff --git a/chromium/third_party/google-closure-library/scripts/ci/check_code_format.sh b/chromium/third_party/google-closure-library/scripts/ci/check_code_format.sh new file mode 100755 index 00000000000..c964d967393 --- /dev/null +++ b/chromium/third_party/google-closure-library/scripts/ci/check_code_format.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# +# Copyright 2018 The Closure Library Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Script to determine if .js files in Pull Request are properly formatted. +# Exits with non 0 exit code if formatting is needed. + +FILES_TO_CHECK=$(git diff --name-only master | grep -E "\.js$") + +if [ -z "${FILES_TO_CHECK}" ]; then + echo "No .js files to check for formatting." + exit 0 +fi + +FORMAT_DIFF=$(git diff -U0 master -- ${FILES_TO_CHECK} | + ../clang/share/clang/clang-format-diff.py -p1 -style=Google) + +if [ -z "${FORMAT_DIFF}" ]; then + # No formatting necessary. + echo "All files in PR properly formatted." + exit 0 +else + # Found diffs. + echo "ERROR: Found formatting errors!" + echo "${FORMAT_DIFF}" + echo "See https://goo.gl/wUEkW9 for instructions to format your PR." + exit 1 +fi diff --git a/chromium/third_party/google-closure-library/scripts/ci/compile_closure.sh b/chromium/third_party/google-closure-library/scripts/ci/compile_closure.sh new file mode 100755 index 00000000000..83cffc62020 --- /dev/null +++ b/chromium/third_party/google-closure-library/scripts/ci/compile_closure.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# Copyright 2018 The Closure Library Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Compiles pertinent Closure library files. + +# TODO(joeltine): Make strictMissingRequire an error when +# @suppress {missingRequire} works for it. + +java -Xmx1G -jar ../closure-compiler-1.0-SNAPSHOT.jar \ + -O ADVANCED \ + --warning_level VERBOSE \ + --jscomp_error='*' \ + --jscomp_off=strictMissingRequire \ + --jscomp_off=extraRequire \ + --jscomp_off=deprecated \ + --jscomp_off=lintChecks \ + --jscomp_off=analyzerChecks \ + --jscomp_warning=unusedLocalVariables \ + --js='**.js' \ + --js='!./closure-deps/**.js' \ + --js='!**_test.js' \ + --js='!**_perf.js' \ + --js='!**tester.js' \ + --js='!**promise/testsuiteadapter.js' \ + --js='!**relativecommontests.js' \ + --js='!**osapi/osapi.js' \ + --js='!**svgpan/svgpan.js' \ + --js='!**alltests.js' \ + --js='!**node_modules**.js' \ + --js='!**protractor_spec.js' \ + --js='!**protractor.conf.js' \ + --js='!**browser_capabilities.js' \ + --js='!**generate_closure_unit_tests.js' \ + --js='!./doc/**.js' \ + --js='!**debug_loader_integration_tests/testdata/**' \ + --js_output_file="$(mktemp)" diff --git a/chromium/third_party/google-closure-library/scripts/ci/deploy.enc b/chromium/third_party/google-closure-library/scripts/ci/deploy.enc new file mode 100644 index 00000000000..e2667a0b339 --- /dev/null +++ b/chromium/third_party/google-closure-library/scripts/ci/deploy.enc @@ -0,0 +1,36 @@ +U2FsdGVkX185yuez28/encpBHtQJVLXZ2dWd9Q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Yh9m9emey72tCqZOQmKobhOyb4x2hEZB4iSdtTf4/o7/bsz2wNXLtMPLd +jneqt9hhBFJnmsoc93xmDLB8SEXJX1IZePLm7QigJj0Fjh4Wqutni9XKNy4LO4s/ +ayBjbjKKjShHM/50+TXqJg== diff --git a/chromium/third_party/google-closure-library/scripts/ci/dossier_readme.md b/chromium/third_party/google-closure-library/scripts/ci/dossier_readme.md new file mode 100644 index 00000000000..98415dd31dd --- /dev/null +++ b/chromium/third_party/google-closure-library/scripts/ci/dossier_readme.md @@ -0,0 +1,15 @@ +<!-- Documentation licensed under CC BY 4.0 --> +<!-- License available at https://creativecommons.org/licenses/by/4.0/ --> + +# Closure Generated API Docs + +This is the generated documentation for the Closure Library +repository at +[github.com/google/closure-library](http://github.com/google/closure-library). + +Use the "Search" bar above to find the Closure API you're looking for. For +example, `goog.array`. Alternatively, explore the APIs using the drop-down +menu in the top-left corner. + +The documentation was produced using +[github.com/jleyba/js-dossier](http://github.com/jleyba/js-dossier) diff --git a/chromium/third_party/google-closure-library/scripts/ci/generate_latest_docs.sh b/chromium/third_party/google-closure-library/scripts/ci/generate_latest_docs.sh new file mode 100755 index 00000000000..c45825f7d43 --- /dev/null +++ b/chromium/third_party/google-closure-library/scripts/ci/generate_latest_docs.sh @@ -0,0 +1,109 @@ +#!/bin/bash +# +# Copyright 2018 The Closure Library Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Rebuild gh-pages branch. + +set -e + +echo "Preparing to generate documentation..." + +COMMIT=${TRAVIS_COMMIT-$(git rev-parse HEAD)} + +export GIT_WORK_TREE="$GH_PAGES" +export GIT_DIR="$GH_PAGES/.git" +mkdir -p "$GIT_DIR" + +# Files to omit from documentation +BLACKLIST_FILES=( + date/relativecommontests.js + events/eventtargettester.js + # Causes an invalid use of goog.base error - disable temporarily. Dossier + # probably just needs a release... + goog.js + i18n/compactnumberformatsymbolsext.js + i18n/datetimepatternsext.js + i18n/listsymbolsext.js + i18n/numberformatsymbolsext.js + promise/testsuiteadapter.js + proto2/package_test.pb.js + proto2/test.pb.js + soy/soy_testhelper.js + style/stylescrollbartester.js + testing/parallel_closure_test_suite.js + test_module.js + test_module_dep.js + tweak/testhelpers.js + transpile.js + useragent/useragenttestutil.js +) +declare -A BLACKLIST +for file in "${BLACKLIST_FILES[@]}"; do + BLACKLIST["$file"]=true +done + +# Pull the existing gh-pages branch, but wipe out the workdir +git init +git remote add origin https://github.com/google/closure-library.git +git remote set-url --push origin git@github.com:google/closure-library.git +git pull --depth=10 origin gh-pages > /dev/null +git checkout gh-pages +git config user.email "travis@travis-ci.org" +git config user.name "travis-ci" +find "$GH_PAGES" -mindepth 1 -maxdepth 1 -path "$GH_PAGES/.git" -prune -o \ + -exec rm -rf {} \; + +# Rearrange files from the repo. +cp -r doc/* "$GH_PAGES/" +mkdir -p "$GH_PAGES/source/closure" +cp -r closure/* "$GH_PAGES/source/closure/" +mkdir -p "$GH_PAGES/api" + +# Download the latest js-dossier release. +npm install js-dossier + +command=( + java -jar node_modules/js-dossier/dossier.jar + --output "$GH_PAGES/api" + --readme scripts/ci/dossier_readme.md + --source_url_template + 'https://github.com/google/closure-library/blob/master/%path%#L%line%' + --type_filter '^goog\.i18n\.\w+_.*' + --type_filter '^goog\.labs\.i18n\.\w+_.*' + --type_filter '^.*+_$' +) + +# Explicitly add all the non-blacklisted files. +while read -r file; do + if [[ ! "$file" =~ ^closure/goog/demos && + ! "$file" =~ ^closure/goog/debug_loader_integration_tests/testdata && + ! "$file" =~ _test\.js$ && + ! "$file" =~ _perf\.js$ && + "${BLACKLIST[${file#closure/goog/}]}" != true ]]; then + command=("${command[@]}" --source "$file") + fi +done < <(find closure/goog third_party/closure/goog -name '*.js') + +# Run dossier. +"${command[@]}" +BUILD=${TRAVIS_BUILD_NUMBER+ after successful travis build $TRAVIS_BUILD_NUMBER} + +# Make a commit. +git add -A +git commit -q --allow-empty -m "Latest documentation auto-pushed to gh-pages + +Built from commit $COMMIT$BUILD." + +echo "gh-pages is ready to push in $GH_PAGES." diff --git a/chromium/third_party/google-closure-library/scripts/ci/ie_setup.bat b/chromium/third_party/google-closure-library/scripts/ci/ie_setup.bat new file mode 100755 index 00000000000..afcf2fe1985 --- /dev/null +++ b/chromium/third_party/google-closure-library/scripts/ci/ie_setup.bat @@ -0,0 +1,70 @@ +:: Copyright 2018 The Closure Library Authors. All Rights Reserved. +:: +:: Licensed under the Apache License, Version 2.0 (the "License"); +:: you may not use this file except in compliance with the License. +:: You may obtain a copy of the License at +:: +:: http://www.apache.org/licenses/LICENSE-2.0 +:: +:: Unless required by applicable law or agreed to in writing, software +:: distributed under the License is distributed on an "AS-IS" BASIS, +:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +:: See the License for the specific language governing permissions and +:: limitations under the License. + +:: Disable "Stop running this script?" alert dialog. +reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Styles" ^ + /v "MaxScriptStatements" /t REG_DWORD /d 0xffffffff /f + +:: Disable Java update dialogs. +reg add ^ + "HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Update\Policy" ^ +reg add ^ + "HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Update\Policy" ^ + /v "EnableJavaUpdate" /t REG_DWORD /d 0 /f +reg add ^ + "HKEY_CURRENT_USER\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" ^ + /v "deployment.expiration.check.enabled" /t REG_SZ /d false /f +reg add ^ + "HKEY_CURRENT_USER\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" ^ + /v "deployment.expiration.decision.10.55.2" /t REG_SZ /d block /f +reg add ^ + "HKEY_CURRENT_USER\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" ^ + /v "deployment.expiration.decision.suppression.10.55.2" /t REG_SZ /d true /f +reg add ^ + "HKEY_CURRENT_USER\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" ^ + /v "deployment.expiration.decision.timestamp.10.55.2" /t REG_SZ /d 1413180896 /f +reg add ^ + "HKEY_CURRENT_USER\Software\Microsoft\Active Setup\Declined Install On Demand IEv5" ^ + /v "{08B0e5c0-4FCB-11CF-AAA5-00401C608501}" /t REG_SZ /d 1 /f /v "EnableJavaUpdate" /t REG_DWORD /d 0 /f + +:: Disable Windows crash dialogs. +reg add ^ + "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting" ^ + /v "DontShowUI" /t REG_DWORD /d 1 /f +reg add ^ + "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting" ^ + /v "ForceQueue" /t REG_DWORD /d 1 /f + +:: Disable JavaScript error dialogs. +reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" ^ + /v "Error Dlg Displayed On Every Error" /t REG_SZ /d no /f + +:: Disable script error dialogs for IE8 & IE9. +reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" ^ + /v "Disable Script Debugger" /t REG_SZ /d yes /f +reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" ^ + /v "DisableScriptDebuggerIE" /t REG_SZ /d yes /f + +:: Disable cross-origin XHRs. Sauce enables this in IE by default. +@ECHO OFF +REG ADD "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /v 1406 /t REG_DWORD /d 3 /f + +setlocal + +set "URL=https://raw.githubusercontent.com/google/closure-library/master/scripts/ci/CloseAdobeDialog.exe" +set "SaveAs=C:\Users\Administrator\Desktop\CloseAdobeDialog.exe" +powershell "Import-Module BitsTransfer; Start-BitsTransfer '%URL%' '%SaveAs%'" + +start C:\Users\Administrator\Desktop\CloseAdobeDialog.exe +exit diff --git a/chromium/third_party/google-closure-library/scripts/ci/install_closure_deps.sh b/chromium/third_party/google-closure-library/scripts/ci/install_closure_deps.sh new file mode 100755 index 00000000000..d9dd5220f8a --- /dev/null +++ b/chromium/third_party/google-closure-library/scripts/ci/install_closure_deps.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# +# Copyright 2018 The Closure Library Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Script to install all necessary dependencies for running Closure tests, +# linting, formatting and compiling. + +declare -r CLANG_VERSION="3.7.1" +declare -r CLANG_BUILD="clang+llvm-${CLANG_VERSION}-x86_64-linux-gnu-ubuntu-14.04" +declare -r CLANG_TAR="${CLANG_BUILD}.tar.xz" +declare -r CLANG_URL="http://llvm.org/releases/${CLANG_VERSION}/${CLANG_TAR}" + +set -ex + +cd .. + +# Fetches Closure Compiler components from oss.sonatype.org +fetch () { + local name="$1" + local snapshots="https://oss.sonatype.org/content/repositories/snapshots" + local repo="$snapshots/com/google/javascript" + local dir="$repo/$name/1.0-SNAPSHOT" + local jar="$name-1.0-SNAPSHOT.jar" + local url=$( + curl -o - "$dir/" | + sed -n 's+.*<a href="\('"$dir/$name"'-[-.0-9]*\.jar\)".*+\1+p' | + head -n 1) + [ -n "$url" ] + wget -O "$jar" "$url" +} + +# Install clang-format. +wget --quiet "$CLANG_URL" +tar xf "$CLANG_TAR" +mv "$CLANG_BUILD" clang +rm -f "$CLANG_TAR" + +# Install closure compiler and linter. +fetch closure-compiler +fetch closure-compiler-linter + +cd closure-library + +# Installs node "devDependencies" found in package.json. +npm install + +# Install Selenium. +./node_modules/protractor/bin/webdriver-manager update + +# Install dependencies in closure-deps +cd closure-deps +npm install diff --git a/chromium/third_party/google-closure-library/scripts/ci/lint_ignore.txt b/chromium/third_party/google-closure-library/scripts/ci/lint_ignore.txt new file mode 100644 index 00000000000..86d6379e41c --- /dev/null +++ b/chromium/third_party/google-closure-library/scripts/ci/lint_ignore.txt @@ -0,0 +1,5 @@ +deps.js +alltests.js +protractor.conf.js +protractor_spec.js +browser_capabilities.js diff --git a/chromium/third_party/google-closure-library/scripts/ci/lint_pull_request.sh b/chromium/third_party/google-closure-library/scripts/ci/lint_pull_request.sh new file mode 100755 index 00000000000..c36e0e60e47 --- /dev/null +++ b/chromium/third_party/google-closure-library/scripts/ci/lint_pull_request.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# +# Copyright 2018 The Closure Library Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Script to run the Compiler's Linter on only the modified or added files in the +# current branch. Should be run from the base git directory with the PR branch +# checked out. + +CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) +CHANGED_FILES=$(git diff --name-only --diff-filter=AM master.."$CURRENT_BRANCH" | + grep -E "\.js$" | + grep -v -E "test\.js$" | + grep -v -f scripts/ci/lint_ignore.txt) + +if [[ -n "$CHANGED_FILES" ]]; then + set -x + java -jar ../closure-compiler-linter-1.0-SNAPSHOT.jar $CHANGED_FILES +else + echo "No .js files found to lint in this Pull Request." +fi diff --git a/chromium/third_party/google-closure-library/scripts/ci/push_latest_docs.sh b/chromium/third_party/google-closure-library/scripts/ci/push_latest_docs.sh new file mode 100755 index 00000000000..39ab7403919 --- /dev/null +++ b/chromium/third_party/google-closure-library/scripts/ci/push_latest_docs.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# +# Copyright 2018 The Closure Library Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Deploy the gh-pages branch, adapted from +# https://github.com/google/dagger/blob/master/util/generate-latest-docs.sh +# See also http://stackoverflow.com/a/22977235 for ssh-based deploy. + +set -e + +# Only push if we've just committed to google/closure-library:master. +# Start by decrypting the deploy password, and pre-populate GitHub's +# RSA key to avoid needing to manually accept it when connecting. +if [ "$TRAVIS_REPO_SLUG" == "google/closure-library" -a \ + "$TRAVIS_PULL_REQUEST" == "false" -a \ + "$TRAVIS_BRANCH" == "master" ]; then + + # If we're on travis, use a secure $deploy_password + if [ -n "$deploy_password" ]; then + touch scripts/ci/deploy + chmod 600 scripts/ci/deploy + openssl aes-256-cbc -k "$deploy_password" -d -a \ + -in scripts/ci/deploy.enc -out scripts/ci/deploy \ + &> /dev/null + echo -e "Host github.com\n IdentityFile $PWD/scripts/ci/deploy" > ~/.ssh/config + echo "github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6Tb + Qa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsd + lLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+S + e8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOz + QgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA + 8VJiS5ap43JXiUFFAaQ==" | sed 's/^ *//' | tr -d '\n' > ~/.ssh/known_hosts + fi + + # Push the commit and delete the repo. + export GIT_WORK_TREE="$GH_PAGES" + export GIT_DIR="$GH_PAGES/.git" + git push -fq origin gh-pages > /dev/null + rm -f scripts/ci/deploy + rm -rf "$GH_PAGES" + echo "Published gh-pages." + +fi diff --git a/chromium/third_party/google-closure-library/scripts/ci/run_all_tests.sh b/chromium/third_party/google-closure-library/scripts/ci/run_all_tests.sh new file mode 100755 index 00000000000..e24e9da9f6e --- /dev/null +++ b/chromium/third_party/google-closure-library/scripts/ci/run_all_tests.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Copyright 2018 The Closure Library Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -x + +# Invoke protractor to run tests. +./node_modules/.bin/protractor protractor.conf.js diff --git a/chromium/third_party/google-closure-library/scripts/ci/sauce_connect.sh b/chromium/third_party/google-closure-library/scripts/ci/sauce_connect.sh new file mode 100755 index 00000000000..7dad00ac39d --- /dev/null +++ b/chromium/third_party/google-closure-library/scripts/ci/sauce_connect.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# +# Copyright 2018 The Closure Library Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e -o pipefail + +# Setup and start Sauce Connect for your TravisCI build +CONNECT_URL="https://saucelabs.com/downloads/sc-4.4.3-linux.tar.gz" +CONNECT_DIR="/tmp/sauce-connect-$RANDOM" +CONNECT_DOWNLOAD="sc-latest-linux.tar.gz" + +BROWSER_PROVIDER_READY_FILE="/tmp/sauce-connect-ready" +CONNECT_LOG="/tmp/sauce-connect" +CONNECT_STDOUT="/tmp/sauce-connect.stdout" +CONNECT_STDERR="/tmp/sauce-connect.stderr" + +# Get Connect and start it +mkdir -p "$CONNECT_DIR" +cd "$CONNECT_DIR" +curl "$CONNECT_URL" -o "$CONNECT_DOWNLOAD" 2> /dev/null 1> /dev/null +mkdir sauce-connect +tar --extract --file="$CONNECT_DOWNLOAD" --strip-components=1 --directory=sauce-connect > /dev/null +rm "$CONNECT_DOWNLOAD" + +ARGS=() + +# Set tunnel-id only on Travis, to make local testing easier. +if [ ! -z "$TRAVIS_JOB_NUMBER" ]; then + ARGS=("${ARGS[@]}" --tunnel-identifier "$TRAVIS_JOB_NUMBER") +fi +if [ ! -z "$BROWSER_PROVIDER_READY_FILE" ]; then + ARGS=("${ARGS[@]}" --readyfile "$BROWSER_PROVIDER_READY_FILE") +fi + + +echo "Starting Sauce Connect in the background, logging into:" +echo " $CONNECT_LOG" +echo " $CONNECT_STDOUT" +echo " $CONNECT_STDERR" +# -B java.com helps to disable Java update popups in IE. +sauce-connect/bin/sc -u "$SAUCE_USERNAME" -k "$SAUCE_ACCESS_KEY" "${ARGS[@]}" \ + --logfile "$CONNECT_LOG" -B java.com & + +# Wait for Connect to be ready before exiting +printf "Connecting to Sauce." +while [ ! -f "$BROWSER_PROVIDER_READY_FILE" ]; do + printf "." + sleep .5 +done +echo "Connected" diff --git a/chromium/third_party/google-closure-library/scripts/ci/test_closuredeps.sh b/chromium/third_party/google-closure-library/scripts/ci/test_closuredeps.sh new file mode 100755 index 00000000000..715e974841b --- /dev/null +++ b/chromium/third_party/google-closure-library/scripts/ci/test_closuredeps.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# +# Copyright 2018 The Closure Library Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Script to test google-closure-deps package + +set -e +cd closure-deps +npm test diff --git a/chromium/third_party/google-closure-library/scripts/http/simple_http_server.py b/chromium/third_party/google-closure-library/scripts/http/simple_http_server.py new file mode 100755 index 00000000000..1ed16dac550 --- /dev/null +++ b/chromium/third_party/google-closure-library/scripts/http/simple_http_server.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python + +# Copyright 2018 The Closure Library Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Simple HTTP server. +""" + +import SimpleHTTPServer +import SocketServer + +PORT = 8080 + + +# Simple server to respond to both POST and GET requests. POST requests will +# just respond as normal GETs. +class ServerHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): + + def do_GET(self): + SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self) + + def do_POST(self): + SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self) + + +Handler = ServerHandler + +# Allows use to restart server immediately after restarting it. +SocketServer.ThreadingTCPServer.allow_reuse_address = True + +httpd = SocketServer.TCPServer(("", PORT), Handler) + +print "Serving at: http://%s:%s" % ("localhost", PORT) +httpd.serve_forever() diff --git a/chromium/third_party/google-closure-library/scripts/release/update_versions.sh b/chromium/third_party/google-closure-library/scripts/release/update_versions.sh new file mode 100755 index 00000000000..8a6c1f1e52e --- /dev/null +++ b/chromium/third_party/google-closure-library/scripts/release/update_versions.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# +# Copyright 2018 The Closure Library Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Updates the versions of Closure's packages for release. Run this before npm +# publish. + +if [[ -z "$1" ]]; then + echo "Usage: $0 <version>" + exit 1 +fi + +perl -pi -e "s/\"version\": \"v?[\d.]+\"/\"version\": \"$1\"/" \ + package.json +perl -pi -e "s/\"version\": \"v?[\d.]+\"/\"version\": \"$1\"/" \ + closure-deps/package.json +perl -pi -e 's/"google-closure-compiler": ".*"/"google-closure-compiler": "\^'"$1"'"/' \ + closure-deps/package.json +perl -pi -e 's/"google-closure-library": ".*"/"google-closure-library": "\^'"$1"'"/' \ + closure-deps/package.json |