Commit 3b8e258d authored by Aaron Leventhal's avatar Aaron Leventhal Committed by Commit Bot

Update presubmit so that extra enums in automation idl are flagged and remove extra focused state

We need to look for extra enums in automation.idl that are not reflected in ax_enums.idl.

Bug: None
Change-Id: I7cf93697f5c09fc48606b787f6ff8b3cb71081f2
Reviewed-on: https://chromium-review.googlesource.com/592054
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490669}
parent 1d8d254c
...@@ -206,7 +206,6 @@ ...@@ -206,7 +206,6 @@
editable, editable,
expanded, expanded,
focusable, focusable,
focused,
haspopup, haspopup,
horizontal, horizontal,
hovered, hovered,
......
...@@ -144,7 +144,6 @@ STATIC_ASSERT_ENUM(kWebAXRoleWindow, kWindowRole); ...@@ -144,7 +144,6 @@ STATIC_ASSERT_ENUM(kWebAXRoleWindow, kWindowRole);
STATIC_ASSERT_ENUM(kWebAXStateBusy, kAXBusyState); STATIC_ASSERT_ENUM(kWebAXStateBusy, kAXBusyState);
STATIC_ASSERT_ENUM(kWebAXStateExpanded, kAXExpandedState); STATIC_ASSERT_ENUM(kWebAXStateExpanded, kAXExpandedState);
STATIC_ASSERT_ENUM(kWebAXStateFocusable, kAXFocusableState); STATIC_ASSERT_ENUM(kWebAXStateFocusable, kAXFocusableState);
STATIC_ASSERT_ENUM(kWebAXStateFocused, kAXFocusedState);
STATIC_ASSERT_ENUM(kWebAXStateHaspopup, kAXHaspopupState); STATIC_ASSERT_ENUM(kWebAXStateHaspopup, kAXHaspopupState);
STATIC_ASSERT_ENUM(kWebAXStateHovered, kAXHoveredState); STATIC_ASSERT_ENUM(kWebAXStateHovered, kAXHoveredState);
STATIC_ASSERT_ENUM(kWebAXStateInvisible, kAXInvisibleState); STATIC_ASSERT_ENUM(kWebAXStateInvisible, kAXInvisibleState);
......
...@@ -142,7 +142,6 @@ enum AccessibilityState { ...@@ -142,7 +142,6 @@ enum AccessibilityState {
kAXBusyState, kAXBusyState,
kAXExpandedState, kAXExpandedState,
kAXFocusableState, kAXFocusableState,
kAXFocusedState,
kAXHaspopupState, kAXHaspopupState,
kAXHoveredState, kAXHoveredState,
kAXInvisibleState, kAXInvisibleState,
......
...@@ -208,7 +208,6 @@ enum WebAXState { ...@@ -208,7 +208,6 @@ enum WebAXState {
kWebAXStateBusy, kWebAXStateBusy,
kWebAXStateExpanded, kWebAXStateExpanded,
kWebAXStateFocusable, kWebAXStateFocusable,
kWebAXStateFocused,
kWebAXStateHaspopup, kWebAXStateHaspopup,
kWebAXStateHovered, kWebAXStateHovered,
kWebAXStateInvisible, kWebAXStateInvisible,
......
...@@ -67,12 +67,22 @@ def CheckMatchingEnum(ax_enums, ...@@ -67,12 +67,22 @@ def CheckMatchingEnum(ax_enums,
src = ax_enums[ax_enum_name] src = ax_enums[ax_enum_name]
dst = automation_enums[automation_enum_name] dst = automation_enums[automation_enum_name]
for value in src: for value in src:
if InitialLowerCamelCase(value) not in dst: lower_value = InitialLowerCamelCase(value)
if lower_value in dst:
dst.remove(lower_value) # Any remaining at end are extra and a mismatch.
else:
errs.append(output_api.PresubmitError( errs.append(output_api.PresubmitError(
'Found %s.%s in %s, but did not find %s.%s in %s' % ( 'Found %s.%s in %s, but did not find %s.%s in %s' % (
ax_enum_name, value, AX_IDL, ax_enum_name, value, AX_IDL,
automation_enum_name, InitialLowerCamelCase(value), automation_enum_name, InitialLowerCamelCase(value),
AUTOMATION_IDL))) AUTOMATION_IDL)))
# Should be no remaining items
for value in dst:
errs.append(output_api.PresubmitError(
'Found %s.%s in %s, but did not find %s.%s in %s' % (
automation_enum_name, value, AUTOMATION_IDL,
ax_enum_name, InitialLowerCamelCase(value),
AX_IDL)))
def CheckEnumsMatch(input_api, output_api): def CheckEnumsMatch(input_api, output_api):
repo_root = input_api.change.RepositoryRoot() repo_root = input_api.change.RepositoryRoot()
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
// TODO(nektar): Migrate entire file to Mojoq. // TODO(nektar): Migrate entire file to Mojoq.
// These should be kept in sync with third_party/WebKit/public/web/WebAXEnums.h // These should be kept in sync with third_party/WebKit/public/web/WebAXEnums.h
// until the Chromium and Blink trees are merged. // until the Chromium and Blink trees are merged.
// Must also be kept in sync with chrome/common/extensions/api/automation.idl.
[camel_case_enum_to_string=true] namespace ui { [camel_case_enum_to_string=true] namespace ui {
// For new entries to the following four enums, also add to // For new entries to the following four enums, also add to
......
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