Fix OSR accessibility tests (issue #2312)

This commit is contained in:
Marshall Greenblatt 2017-12-12 15:57:38 -05:00
parent ab289f8c21
commit 385b2d4fb7

View File

@ -135,8 +135,8 @@ class AccessibilityTestHandler : public TestHandler,
// Get the first update dict and validate event type // Get the first update dict and validate event type
CefRefPtr<CefDictionaryValue> dict = list->GetDictionary(0); CefRefPtr<CefDictionaryValue> dict = list->GetDictionary(0);
// ignore other events // Ignore other events.
if (dict->GetString("event_type").ToString() != "layoutComplete") if (dict->GetString("event_type") != "layoutComplete")
break; break;
SetEditBoxIdAndRect(dict->GetDictionary("update")); SetEditBoxIdAndRect(dict->GetDictionary("update"));
@ -159,8 +159,8 @@ class AccessibilityTestHandler : public TestHandler,
// Get the first update dict and validate event type // Get the first update dict and validate event type
CefRefPtr<CefDictionaryValue> dict = list->GetDictionary(0); CefRefPtr<CefDictionaryValue> dict = list->GetDictionary(0);
// ignore other events // Ignore other events.
if (dict->GetString("event_type").ToString() != "layoutComplete") if (dict->GetString("event_type") != "layoutComplete")
break; break;
// Now post a delayed task to trigger focus to edit box // Now post a delayed task to trigger focus to edit box
@ -183,9 +183,9 @@ class AccessibilityTestHandler : public TestHandler,
// Get the first update dict and validate event type // Get the first update dict and validate event type
CefRefPtr<CefDictionaryValue> dict = list->GetDictionary(0); CefRefPtr<CefDictionaryValue> dict = list->GetDictionary(0);
// Validate Event type is Focus change // Ignore other events.
EXPECT_STREQ("focus", if (dict->GetString("event_type") != "focus")
dict->GetString("event_type").ToString().c_str()); return;
// And Focus is set to expected element edit_box // And Focus is set to expected element edit_box
EXPECT_TRUE(edit_box_id_ == dict->GetInt("id")); EXPECT_TRUE(edit_box_id_ == dict->GetInt("id"));
@ -295,8 +295,10 @@ class AccessibilityTestHandler : public TestHandler,
// Get the first update dict and validate event type. // Get the first update dict and validate event type.
CefRefPtr<CefDictionaryValue> dict = list->GetDictionary(0); CefRefPtr<CefDictionaryValue> dict = list->GetDictionary(0);
EXPECT_STREQ("layoutComplete",
dict->GetString("event_type").ToString().c_str()); // Ignore other events.
if (dict->GetString("event_type") != "layoutComplete")
return;
// Get update and validate it has tree data // Get update and validate it has tree data
CefRefPtr<CefDictionaryValue> update = dict->GetDictionary("update"); CefRefPtr<CefDictionaryValue> update = dict->GetDictionary("update");