Commit a1995611 authored by Aaron Leventhal's avatar Aaron Leventhal Committed by Commit Bot

Instructions getting stack of errant view's construction

When a view fails an accessibility check, it can be very helpful to find
out what line of code constructed it. This provides information on how
to patch in code that does that.

We may want to build this in at some point:
See https://crrev.com/c/1025637 or https://crrev.com/c/963284.

Bug: 811293
Change-Id: I14046d7d40a5475e28691d371acdcb6538b66663
Reviewed-on: https://chromium-review.googlesource.com/1026055Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553295}
parent 1a9c502d
...@@ -89,7 +89,10 @@ bool DoesViewHaveAccessibilityErrors(views::View* view, ...@@ -89,7 +89,10 @@ bool DoesViewHaveAccessibilityErrors(views::View* view,
"The following view violates DoesViewHaveAccessibilityErrors() when its " "The following view violates DoesViewHaveAccessibilityErrors() when its "
"widget becomes " + "widget becomes " +
std::string(view->GetWidget()->IsVisible() ? "visible:\n" : "hidden:\n") + std::string(view->GetWidget()->IsVisible() ? "visible:\n" : "hidden:\n") +
GetViewDebugString(view) + violations; GetViewDebugString(view) + violations +
"\n\nNote: for a more useful error message that includes a stack of how "
"this view was constructed, use git cl patch 963284. Please leave a note "
"on that CL if you find it useful.";
return true; return true;
} }
......
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