Commit 66699e73 authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Remove use of MAC_OS_X_VERSION_10_12

MAC_OS_X_VERSION_10_12 is true if Chromium is being built with the
macOS 10.12 SDK or newer, as it’s been since mid 2017.

MAC_OS_X_VERSION_10_12 is not a runtime check for macOS 10.12
and cannot be used as such.

Bug: 1044838, 992915
Change-Id: I28e00f3786831e8899eef917cb5eda3d031e1a2c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2016847
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#734605}
parent d593f348
......@@ -8,6 +8,7 @@
#import <Cocoa/Cocoa.h>
#include <stddef.h>
#include "base/mac/mac_util.h"
#include "base/stl_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#import "ui/events/cocoa/cocoa_event_utils.h"
......@@ -674,10 +675,13 @@ TEST(WebInputEventBuilderMacTest, ScrollWheelMatchesUIEvent) {
[window close];
}
#if !defined(MAC_OS_X_VERSION_10_12)
// Test if the value of twist and rotation_angle are set correctly when the
// NSEvent's rotation is less than 90.
TEST(WebInputEventBuilderMacTest, TouchEventsWithPointerTypePenRotationLess90) {
if (base::mac::IsOS10_12()) {
// Fails on macOS 10.12; https://crbug.com/992915
return;
}
NSEvent* mac_event =
BuildFakeMouseEvent(kCGEventLeftMouseDown, {6, 9}, kCGMouseButtonLeft,
kCGEventMouseSubtypeTabletPoint, 60.0);
......@@ -697,6 +701,10 @@ TEST(WebInputEventBuilderMacTest, TouchEventsWithPointerTypePenRotationLess90) {
// NSEvent's rotation is between 90 and 180.
TEST(WebInputEventBuilderMacTest,
TouchEventsWithPointerTypePenRotationLess180) {
if (base::mac::IsOS10_12()) {
// Fails on macOS 10.12; https://crbug.com/992915
return;
}
NSEvent* mac_event =
BuildFakeMouseEvent(kCGEventLeftMouseDown, {6, 9}, kCGMouseButtonLeft,
kCGEventMouseSubtypeTabletPoint, 160.0);
......@@ -716,6 +724,10 @@ TEST(WebInputEventBuilderMacTest,
// NSEvent's rotation is between 180 and 360.
TEST(WebInputEventBuilderMacTest,
TouchEventsWithPointerTypePenRotationLess360) {
if (base::mac::IsOS10_12()) {
// Fails on macOS 10.12; https://crbug.com/992915
return;
}
NSEvent* mac_event =
BuildFakeMouseEvent(kCGEventLeftMouseDown, {6, 9}, kCGMouseButtonLeft,
kCGEventMouseSubtypeTabletPoint, 260.0);
......@@ -735,6 +747,10 @@ TEST(WebInputEventBuilderMacTest,
// NSEvent's rotation is greater than 360.
TEST(WebInputEventBuilderMacTest,
TouchEventsWithPointerTypePenRotationGreater360) {
if (base::mac::IsOS10_12()) {
// Fails on macOS 10.12; https://crbug.com/992915
return;
}
NSEvent* mac_event =
BuildFakeMouseEvent(kCGEventLeftMouseDown, {6, 9}, kCGMouseButtonLeft,
kCGEventMouseSubtypeTabletPoint, 390.0);
......@@ -752,6 +768,10 @@ TEST(WebInputEventBuilderMacTest,
// Test if all the values of a WebTouchEvent are set correctly.
TEST(WebInputEventBuilderMacTest, BuildWebTouchEvents) {
if (base::mac::IsOS10_12()) {
// Fails on macOS 10.12; https://crbug.com/992915
return;
}
NSEvent* mac_event = BuildFakeMouseEvent(
kCGEventLeftMouseDown, {6, 9}, kCGMouseButtonLeft,
kCGEventMouseSubtypeTabletPoint, /* rotation */ 60.0,
......@@ -781,7 +801,6 @@ TEST(WebInputEventBuilderMacTest, BuildWebTouchEvents) {
EXPECT_EQ(60, touch_event.touches[0].twist);
EXPECT_FLOAT_EQ(60.0, touch_event.touches[0].rotation_angle);
}
#endif // MAC_OS_X_VERSION_10_12
// Test if the mouse back button values of a WebMouseEvent are set correctly.
TEST(WebInputEventBuilderMacTest, BuildWebMouseEventsWithBackButton) {
......
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