Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: ct/go/worker_scripts/capture_skps/main.go

Issue 1870173002: [CT] Add desktop device when running run_benchmark (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ct/go/worker_scripts/fix_archives/main.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Application that captures SKPs from CT's webpage archives. 1 // Application that captures SKPs from CT's webpage archives.
2 package main 2 package main
3 3
4 import ( 4 import (
5 "encoding/csv" 5 "encoding/csv"
6 "flag" 6 "flag"
7 "fmt" 7 "fmt"
8 "io/ioutil" 8 "io/ioutil"
9 "os" 9 "os"
10 "path/filepath" 10 "path/filepath"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 filepath.Join(util.TelemetryBinariesDir, util.BINARY_RUN_BENCHMARK), 172 filepath.Join(util.TelemetryBinariesDir, util.BINARY_RUN_BENCHMARK),
173 util.BenchmarksToTelemetryName[util.BENC HMARK_SKPICTURE_PRINTER], 173 util.BenchmarksToTelemetryName[util.BENC HMARK_SKPICTURE_PRINTER],
174 "--also-run-disabled-tests", 174 "--also-run-disabled-tests",
175 "--page-repeat=1", // Only need one run for SKPs. 175 "--page-repeat=1", // Only need one run for SKPs.
176 "--skp-outdir=" + pathToSkps, 176 "--skp-outdir=" + pathToSkps,
177 "--extra-browser-args=" + util.DEFAULT_B ROWSER_ARGS, 177 "--extra-browser-args=" + util.DEFAULT_B ROWSER_ARGS,
178 "--user-agent=" + decodedPageset.UserAge nt, 178 "--user-agent=" + decodedPageset.UserAge nt,
179 "--urls-list=" + decodedPageset.UrlsList , 179 "--urls-list=" + decodedPageset.UrlsList ,
180 "--archive-data-file=" + decodedPageset. ArchiveDataFile, 180 "--archive-data-file=" + decodedPageset. ArchiveDataFile,
181 } 181 }
182 » » » » // Figure out which browser should be used. 182 » » » » // Figure out which browser and device should be used.
183 if *targetPlatform == util.PLATFORM_ANDROID { 183 if *targetPlatform == util.PLATFORM_ANDROID {
184 args = append(args, "--browser=android-c hromium") 184 args = append(args, "--browser=android-c hromium")
185 } else { 185 } else {
186 args = append(args, "--browser=exact", " --browser-executable="+chromiumBinary) 186 args = append(args, "--browser=exact", " --browser-executable="+chromiumBinary)
187 args = append(args, "--device=desktop")
187 } 188 }
188 // Set the PYTHONPATH to the pagesets and the te lemetry dirs. 189 // Set the PYTHONPATH to the pagesets and the te lemetry dirs.
189 env := []string{ 190 env := []string{
190 fmt.Sprintf("PYTHONPATH=%s:%s:%s:%s:$PYT HONPATH", pathToPagesets, util.TelemetryBinariesDir, util.TelemetrySrcDir, util. CatapultSrcDir), 191 fmt.Sprintf("PYTHONPATH=%s:%s:%s:%s:$PYT HONPATH", pathToPagesets, util.TelemetryBinariesDir, util.TelemetrySrcDir, util. CatapultSrcDir),
191 "DISPLAY=:0", 192 "DISPLAY=:0",
192 } 193 }
193 skutil.LogErr( 194 skutil.LogErr(
194 util.ExecuteCmd("python", args, env, tim e.Duration(timeoutSecs)*time.Second, nil, nil)) 195 util.ExecuteCmd("python", args, env, tim e.Duration(timeoutSecs)*time.Second, nil, nil))
195 196
196 mutex.RUnlock() 197 mutex.RUnlock()
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 } 299 }
299 writer := csv.NewWriter(csvFile) 300 writer := csv.NewWriter(csvFile)
300 defer writer.Flush() 301 defer writer.Flush()
301 for _, row := range [][]string{headers, values} { 302 for _, row := range [][]string{headers, values} {
302 if err := writer.Write(row); err != nil { 303 if err := writer.Write(row); err != nil {
303 return fmt.Errorf("Could not write to %s: %s", csvPath, err) 304 return fmt.Errorf("Could not write to %s: %s", csvPath, err)
304 } 305 }
305 } 306 }
306 return nil 307 return nil
307 } 308 }
OLDNEW
« no previous file with comments | « no previous file | ct/go/worker_scripts/fix_archives/main.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698