Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3846)

Unified Diff: chrome/test/base/interactive_test_utils_mac.mm

Issue 642143004: [Cocoa] Make TabContentsContainerView more testable for interactive_ui_tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/base/interactive_test_utils_mac.mm
diff --git a/chrome/test/base/interactive_test_utils_mac.mm b/chrome/test/base/interactive_test_utils_mac.mm
index fcf5f124f1f1e719067dafe11595c758642694f5..424f98afd9a84143e38521cb3d1aea03b65c9b9a 100644
--- a/chrome/test/base/interactive_test_utils_mac.mm
+++ b/chrome/test/base/interactive_test_utils_mac.mm
@@ -54,6 +54,13 @@ bool IsViewFocused(const Browser* browser, ViewID vid) {
if (firstResponder == static_cast<NSResponder*>(view))
return true;
+ // Handle special case for VIEW_ID_TAB_CONTAINER. The tab container NSView
+ // always transfers first responder status to its subview, so test whether
+ // |firstResponder| is a descendant.
+ if (vid == VIEW_ID_TAB_CONTAINER &&
+ [firstResponder isKindOfClass:[NSView class]])
+ return [static_cast<NSView*>(firstResponder) isDescendantOf:view];
+
// Handle the special case of focusing a TextField.
if ([firstResponder isKindOfClass:[NSTextView class]]) {
NSView* delegate = static_cast<NSView*>([(NSTextView*)firstResponder

Powered by Google App Engine
This is Rietveld 408576698