Commit 75fec93c authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

chrome: define CHROME_VERSION_{MAJOR,MINOR,BUILD,PATCH}

Also, replace an existing use of CHROME_VERSION with _MAJOR.

Bug: None
Change-Id: I838874595dd5e4f11df3c2902745b4d3763b9596
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2149402Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#758971}
parent d8fe759d
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
#define CHROME_VERSION @MAJOR@,@MINOR@,@BUILD@,@PATCH@ #define CHROME_VERSION @MAJOR@,@MINOR@,@BUILD@,@PATCH@
#define CHROME_VERSION_STRING "@MAJOR@.@MINOR@.@BUILD@.@PATCH@" #define CHROME_VERSION_STRING "@MAJOR@.@MINOR@.@BUILD@.@PATCH@"
#define CHROME_VERSION_MAJOR @MAJOR@
#define CHROME_VERSION_MINOR @MINOR@
#define CHROME_VERSION_BUILD @BUILD@
#define CHROME_VERSION_PATCH @PATCH@
// Branding Information // Branding Information
......
...@@ -154,8 +154,6 @@ source_set("automation_client_lib") { ...@@ -154,8 +154,6 @@ source_set("automation_client_lib") {
"chrome/ui_events.h", "chrome/ui_events.h",
"chrome/util.cc", "chrome/util.cc",
"chrome/util.h", "chrome/util.h",
"chrome/version.cc",
"chrome/version.h",
"chrome/web_view.h", "chrome/web_view.h",
"chrome/web_view_impl.cc", "chrome/web_view_impl.cc",
"chrome/web_view_impl.h", "chrome/web_view_impl.h",
......
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/test/chromedriver/chrome/version.h"
#include "base/strings/stringprintf.h"
#include "chrome/common/chrome_version.h"
namespace {
const int kSupportedBrowserVersion[] = {CHROME_VERSION};
} // namespace
const int kSupportedBrowserMajorVersion = kSupportedBrowserVersion[0];
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_result_codes.h" #include "chrome/common/chrome_result_codes.h"
#include "chrome/common/chrome_version.h"
#include "chrome/test/chromedriver/chrome/chrome_android_impl.h" #include "chrome/test/chromedriver/chrome/chrome_android_impl.h"
#include "chrome/test/chromedriver/chrome/chrome_desktop_impl.h" #include "chrome/test/chromedriver/chrome/chrome_desktop_impl.h"
#include "chrome/test/chromedriver/chrome/chrome_finder.h" #include "chrome/test/chromedriver/chrome/chrome_finder.h"
...@@ -48,7 +49,6 @@ ...@@ -48,7 +49,6 @@
#include "chrome/test/chromedriver/chrome/embedded_automation_extension.h" #include "chrome/test/chromedriver/chrome/embedded_automation_extension.h"
#include "chrome/test/chromedriver/chrome/status.h" #include "chrome/test/chromedriver/chrome/status.h"
#include "chrome/test/chromedriver/chrome/user_data_dir.h" #include "chrome/test/chromedriver/chrome/user_data_dir.h"
#include "chrome/test/chromedriver/chrome/version.h"
#include "chrome/test/chromedriver/chrome/web_view.h" #include "chrome/test/chromedriver/chrome/web_view.h"
#include "chrome/test/chromedriver/constants/version.h" #include "chrome/test/chromedriver/constants/version.h"
#include "chrome/test/chromedriver/log_replay/chrome_replay_impl.h" #include "chrome/test/chromedriver/log_replay/chrome_replay_impl.h"
...@@ -265,14 +265,13 @@ Status WaitForDevToolsAndCheckVersion( ...@@ -265,14 +265,13 @@ Status WaitForDevToolsAndCheckVersion(
LOG(WARNING) << "You are using an unsupported command-line switch: " LOG(WARNING) << "You are using an unsupported command-line switch: "
"--disable-build-check. Please don't report bugs that " "--disable-build-check. Please don't report bugs that "
"cannot be reproduced with this switch removed."; "cannot be reproduced with this switch removed.";
} else if (browser_info->major_version != kSupportedBrowserMajorVersion) { } else if (browser_info->major_version != CHROME_VERSION_MAJOR) {
if (browser_info->major_version == 0) { if (browser_info->major_version == 0) {
// TODO(https://crbug.com/932013): Content Shell doesn't report a version // TODO(https://crbug.com/932013): Content Shell doesn't report a version
// number. Skip version checking with a warning. // number. Skip version checking with a warning.
LOG(WARNING) << "Unable to retrieve " << kBrowserShortName LOG(WARNING) << "Unable to retrieve " << kBrowserShortName
<< " version. Unable to verify browser compatibility."; << " version. Unable to verify browser compatibility.";
} else if (browser_info->major_version == } else if (browser_info->major_version == CHROME_VERSION_MAJOR + 1) {
kSupportedBrowserMajorVersion + 1) {
// TODO(https://crbug.com/chromedriver/2656): Since we don't currently // TODO(https://crbug.com/chromedriver/2656): Since we don't currently
// release ChromeDriver for dev or canary channels, allow using // release ChromeDriver for dev or canary channels, allow using
// ChromeDriver version n (e.g., Beta) with Chrome version n+1 (e.g., Dev // ChromeDriver version n (e.g., Beta) with Chrome version n+1 (e.g., Dev
...@@ -286,7 +285,7 @@ Status WaitForDevToolsAndCheckVersion( ...@@ -286,7 +285,7 @@ Status WaitForDevToolsAndCheckVersion(
kSessionNotCreated, kSessionNotCreated,
base::StringPrintf("This version of %s only supports %s version %d", base::StringPrintf("This version of %s only supports %s version %d",
kChromeDriverProductFullName, kBrowserShortName, kChromeDriverProductFullName, kBrowserShortName,
kSupportedBrowserMajorVersion)); CHROME_VERSION_MAJOR));
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment