Skip to content

Commit

Permalink
headless: Allow both WW,HH and WWxHH forms for specifying window size
Browse files Browse the repository at this point in the history
As Chrome only supports the former format, change the documentation to
refer to that.

BUG=678539

Review-Url: https://codereview.chromium.org/2622773003
Cr-Commit-Position: refs/heads/master@{#442609}
  • Loading branch information
skyostil authored and Commit bot committed Jan 10, 2017
1 parent 2465bc7 commit caa5c48
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion headless/app/headless_shell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const char kDefaultScreenshotFileName[] = "screenshot.png";

bool ParseWindowSize(std::string window_size, gfx::Size* parsed_window_size) {
int width, height = 0;
if (sscanf(window_size.c_str(), "%dx%d", &width, &height) >= 2 &&
if (sscanf(window_size.c_str(), "%d%*[x,]%d", &width, &height) >= 2 &&
width >= 0 && height >= 0) {
parsed_window_size->set_width(width);
parsed_window_size->set_height(height);
Expand Down
2 changes: 1 addition & 1 deletion headless/app/headless_shell_switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const char kUserDataDir[] = "user-data-dir";
// specified virtual time budget is exhausted.
const char kVirtualTimeBudget[] = "virtual-time-budget";

// Sets the initial window size. Provided as string in the format "800x600".
// Sets the initial window size. Provided as string in the format "800,600".
const char kWindowSize[] = "window-size";

} // namespace switches
Expand Down

0 comments on commit caa5c48

Please sign in to comment.