Commit f9559e07 authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Fix Mac OS version test in services_unittests

Allow the major version to go above 10.

Bug: 1121703
Change-Id: I01a6c804d626558ed5e6fcce3a00dc11c78a349c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2377559
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801930}
parent 024d302d
......@@ -5,6 +5,7 @@
#include "services/shape_detection/barcode_detection_impl_mac_vision.h"
#include <Foundation/Foundation.h>
#include <vector>
#include "base/bind.h"
......@@ -12,6 +13,7 @@
#include "base/containers/flat_set.h"
#include "base/logging.h"
#include "base/strings/sys_string_conversions.h"
#include "base/system/sys_info.h"
#include "third_party/skia/include/core/SkBitmap.h"
namespace shape_detection {
......@@ -109,15 +111,17 @@ void UpdateSymbologyHint(mojom::BarcodeFormat format,
}
}
} // unnamed namespace
} // namespace
// static
bool BarcodeDetectionImplMacVision::IsBlockedMacOSVersion() {
static NSOperatingSystemVersion version =
[[NSProcessInfo processInfo] operatingSystemVersion];
DCHECK_EQ(version.majorVersion, 10);
int32_t major_version;
int32_t minor_version;
int32_t bugfix_version;
base::SysInfo::OperatingSystemVersionNumbers(&major_version, &minor_version,
&bugfix_version);
// Vision Framework doesn't work properly on 10.14.{0,1,2}: crbug.com/921968.
return version.minorVersion == 14 && version.patchVersion < 3;
return major_version == 10 && minor_version == 14 && bugfix_version < 3;
}
BarcodeDetectionImplMacVision::BarcodeDetectionImplMacVision(
......
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