@@ -79,92 +79,72 @@ function run_test_impl {
7979
8080 echo " URL: $url "
8181
82- case " $BROWSER " in
83-
84- " firefox" )
85- kill -9 $( ps -x | grep firefox | awk ' {print $1}' ) || true
86-
87- local profile_path=" /firefox-profile"
88- [ " $GITHUBACTION " == " true" ] && profile_path=" /tmp/firefox-profile"
89- local firefox_args=" -profile $profile_path $url "
90- [ " $NO_HEADLESS " != " true" ] && firefox_args=" -headless $firefox_args "
91-
92- firefox --version
93- echo " $firefox_args "
94-
95- firefox $firefox_args &
96- ;;
97-
98- * )
99- local chrome_command=$CHROME_CMD
100- local chrome_args=(
101- --no-sandbox
102- --headless
103- --disable-gpu
104- --disable-partial-raster
105- --disable-skia-runtime-opts
106- --no-first-run
107- --run-all-compositor-stages-before-draw
108- --disable-new-content-rendering-timeout
109- --disable-background-timer-throttling
110- --disable-renderer-backgrounding
111- --disable-threaded-animation
112- --disable-threaded-scrolling
113- --disable-checker-imaging
114- --disable-image-animation-resync
115- --use-gl=" swiftshader"
116- --disable-features=PaintHolding
117- --disable-features=ScriptStreaming
118- --disable-features=LazyFrameLoading
119- --font-render-hinting=none
120- --disable-font-subpixel-positioning
121- --disable-extensions
122- )
123-
124- if [ " $NO_HEADLESS " == " true" ]; then
125- chrome_command=" dbus-launch --exit-with-session $chrome_command "
126- chrome_args+=(
127- --no-first-run
128- --no-default-browser-check
129- --disable-translate
130- )
131- fi
82+ local chrome_command=$CHROME_CMD
83+ local chrome_args=(
84+ --no-sandbox
85+ --headless
86+ --disable-gpu
87+ --disable-partial-raster
88+ --disable-skia-runtime-opts
89+ --no-first-run
90+ --run-all-compositor-stages-before-draw
91+ --disable-new-content-rendering-timeout
92+ --disable-background-timer-throttling
93+ --disable-renderer-backgrounding
94+ --disable-threaded-animation
95+ --disable-threaded-scrolling
96+ --disable-checker-imaging
97+ --disable-image-animation-resync
98+ --use-gl=" swiftshader"
99+ --disable-features=PaintHolding
100+ --disable-features=ScriptStreaming
101+ --disable-features=LazyFrameLoading
102+ --font-render-hinting=none
103+ --disable-font-subpixel-positioning
104+ --disable-extensions
105+ )
132106
133- if [ -n " $MOBILE_UA " ]; then
134- local user_agent
135-
136- if [ " $MOBILE_UA " == " ios10" ]; then
137- user_agent=" Mozilla/5.0 (iPad; CPU OS 10_2_1 like Mac OS X) AppleWebKit/602.4.6 (KHTML, like Gecko) Version/10.0 Mobile/14D27 Safari/602.1)"
138- elif [ " $MOBILE_UA " == " android6" ]; then
139- user_agent=" Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Mobile Safari/537.36"
140- else
141- return 1
142- fi
143-
144- echo " Mobile user agent: $MOBILE_UA "
145-
146- chrome_args+=(
147- --user-agent=" '$user_agent '"
148- --enable-viewport
149- --touch-events
150- --enable-overlay-scrollbar
151- --enable-features=OverlayScrollbar
152- )
153- fi
154- if [ " $GITHUBACTION " == " true" ]; then
155- echo " $chrome_command "
156- printf ' %s\n' " ${chrome_args[@]} "
157- else
158- tput setaf 6
159- echo " $chrome_command "
160- printf ' %s\n' " ${chrome_args[@]} "
161- tput setaf 9
162- fi
163- eval " $chrome_command --version"
164- eval " $chrome_command ${chrome_args[@]} '$url '" & > chrome.log &
165- ;;
107+ if [ " $NO_HEADLESS " == " true" ]; then
108+ chrome_command=" dbus-launch --exit-with-session $chrome_command "
109+ chrome_args+=(
110+ --no-first-run
111+ --no-default-browser-check
112+ --disable-translate
113+ )
114+ fi
115+
116+ if [ -n " $MOBILE_UA " ]; then
117+ local user_agent
166118
167- esac
119+ if [ " $MOBILE_UA " == " ios10" ]; then
120+ user_agent=" Mozilla/5.0 (iPad; CPU OS 10_2_1 like Mac OS X) AppleWebKit/602.4.6 (KHTML, like Gecko) Version/10.0 Mobile/14D27 Safari/602.1)"
121+ elif [ " $MOBILE_UA " == " android6" ]; then
122+ user_agent=" Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Mobile Safari/537.36"
123+ else
124+ return 1
125+ fi
126+
127+ echo " Mobile user agent: $MOBILE_UA "
128+
129+ chrome_args+=(
130+ --user-agent=" '$user_agent '"
131+ --enable-viewport
132+ --touch-events
133+ --enable-overlay-scrollbar
134+ --enable-features=OverlayScrollbar
135+ )
136+ fi
137+ if [ " $GITHUBACTION " == " true" ]; then
138+ echo " $chrome_command "
139+ printf ' %s\n' " ${chrome_args[@]} "
140+ else
141+ tput setaf 6
142+ echo " $chrome_command "
143+ printf ' %s\n' " ${chrome_args[@]} "
144+ tput setaf 9
145+ fi
146+ eval " $chrome_command --version"
147+ eval " $chrome_command ${chrome_args[@]} '$url '" & > chrome.log &
168148
169149 start_runner_watchdog $runner_pid
170150 wait $runner_pid || runner_result=1
0 commit comments