Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / test / base / interactive_test_utils_mac.mm
index fcf5f12..424f98a 100644 (file)
@@ -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