Skip to content

Commit

Permalink
Fix Mac OS version test in services_unittests
Browse files Browse the repository at this point in the history
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: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801930}
  • Loading branch information
Avi Drissman authored and Commit Bot committed Aug 26, 2020
1 parent 024d302 commit f9559e0
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions services/shape_detection/barcode_detection_impl_mac_vision.mm
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
#include "services/shape_detection/barcode_detection_impl_mac_vision.h"

#include <Foundation/Foundation.h>

#include <vector>

#include "base/bind.h"
#include "base/callback.h"
#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 {
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit f9559e0

Please sign in to comment.