diff options
author | nektar <nektar@chromium.org> | 2015-08-28 17:03:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-29 00:04:34 +0000 |
commit | 169d4b8ce0cb137e1f143da4e57d95f2a03c9c9d (patch) | |
tree | bf51574179e18bc2a808aa38ba23f00976815c4e | |
parent | b6705681a1159efe624e1f80f547272f5a19245e (diff) | |
download | chromium_src-169d4b8ce0cb137e1f143da4e57d95f2a03c9c9d.zip chromium_src-169d4b8ce0cb137e1f143da4e57d95f2a03c9c9d.tar.gz chromium_src-169d4b8ce0cb137e1f143da4e57d95f2a03c9c9d.tar.bz2 |
Re-enabled contenteditable and text-changed tests after content editable work has been submitted.
BUG=491027
R=dmazzoni@chromium.org
Committed: https://crrev.com/2a08efd44ef185753219067e059deec217fcf4ea
Cr-Commit-Position: refs/heads/master@{#344684}
Committed: https://crrev.com/4ed230441a93a55e7d90bfcd5d5f4cceb4f4e326
Cr-Commit-Position: refs/heads/master@{#345734}
Review URL: https://codereview.chromium.org/1292193004
Cr-Commit-Position: refs/heads/master@{#346281}
7 files changed, 35 insertions, 25 deletions
diff --git a/content/browser/accessibility/accessibility_tree_formatter_win.cc b/content/browser/accessibility/accessibility_tree_formatter_win.cc index ab34a93..104da65 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_win.cc +++ b/content/browser/accessibility/accessibility_tree_formatter_win.cc @@ -22,7 +22,6 @@ #include "third_party/iaccessible2/ia2_api_all.h" #include "ui/base/win/atl_module.h" -using base::StringPrintf; namespace content { @@ -96,15 +95,22 @@ base::string16 GetIA2Hypertext(BrowserAccessibilityWin& ax_object) { if (hr == S_OK) { DCHECK_GE(index_of_embed, 0); base::win::ScopedComPtr<IAccessibleHyperlink> embedded_object; - DCHECK(SUCCEEDED(ax_object.get_hyperlink( - index_of_embed, embedded_object.Receive()))); + HRESULT hr = ax_object.get_hyperlink( + index_of_embed, embedded_object.Receive()); + DCHECK(SUCCEEDED(hr)); base::win::ScopedComPtr<IAccessible2> ax_embed; - DCHECK(SUCCEEDED(embedded_object.QueryInterface(ax_embed.Receive()))); - DCHECK(SUCCEEDED(ax_embed->get_indexInParent(&child_index))); + hr = embedded_object.QueryInterface(ax_embed.Receive()); + DCHECK(SUCCEEDED(hr)); + hr = ax_embed->get_indexInParent(&child_index); + DCHECK(SUCCEEDED(hr)); } - base::string16 child_index_str = base::StringPrintf(L"<obj%d>", - child_index); + base::string16 child_index_str(L"<obj"); + if (child_index >= 0) { + base::StringAppendF(&child_index_str, L"%d>", child_index); + } else { + base::StringAppendF(&child_index_str, L">"); + } base::ReplaceFirstSubstringAfterOffset(&ia2_hypertext, hypertext_index, embedded_character, child_index_str); ++character_index; @@ -303,7 +309,7 @@ base::string16 AccessibilityTreeFormatter::ToString( base::string16 string_value; value->GetAsString(&string_value); WriteAttribute(false, - StringPrintf(L"%ls='%ls'", + base::StringPrintf(L"%ls='%ls'", base::UTF8ToUTF16(attribute_name).c_str(), string_value.c_str()), &line); diff --git a/content/browser/accessibility/browser_accessibility_win.cc b/content/browser/accessibility/browser_accessibility_win.cc index b4d0aa5..76d15c7 100644 --- a/content/browser/accessibility/browser_accessibility_win.cc +++ b/content/browser/accessibility/browser_accessibility_win.cc @@ -3526,16 +3526,6 @@ void BrowserAccessibilityWin::UpdateStep3FireEvents(bool is_subtree_creation) { previous_scroll_y_ = sy; } - // Changing a static text node can affect the IAccessibleText hypertext - // of the parent node, so force an update on the parent. - BrowserAccessibilityWin* parent = GetParent()->ToBrowserAccessibilityWin(); - if (parent && IsTextOnlyObject() && - name() != old_win_attributes_->name) { - parent->UpdateStep1ComputeWinAttributes(); - parent->UpdateStep2ComputeHypertext(); - parent->UpdateStep3FireEvents(false); - } - // Fire hypertext-related events. int start, old_len, new_len; ComputeHypertextRemovedAndInserted(&start, &old_len, &new_len); @@ -3549,6 +3539,16 @@ void BrowserAccessibilityWin::UpdateStep3FireEvents(bool is_subtree_creation) { // in reaction to this event to retrieve the text that was inserted. manager->MaybeCallNotifyWinEvent(IA2_EVENT_TEXT_INSERTED, this); } + + // Changing a static text node can affect the IAccessibleText hypertext + // of the parent node, so force an update on the parent. + BrowserAccessibilityWin* parent = GetParent()->ToBrowserAccessibilityWin(); + if (parent && IsTextOnlyObject() && + name() != old_win_attributes_->name) { + parent->UpdateStep1ComputeWinAttributes(); + parent->UpdateStep2ComputeHypertext(); + parent->UpdateStep3FireEvents(false); + } } old_win_attributes_.reset(nullptr); diff --git a/content/browser/accessibility/dump_accessibility_events_browsertest.cc b/content/browser/accessibility/dump_accessibility_events_browsertest.cc index 581d519..304fc07 100644 --- a/content/browser/accessibility/dump_accessibility_events_browsertest.cc +++ b/content/browser/accessibility/dump_accessibility_events_browsertest.cc @@ -264,7 +264,7 @@ IN_PROC_BROWSER_TEST_F(DumpAccessibilityEventsTest, } IN_PROC_BROWSER_TEST_F(DumpAccessibilityEventsTest, - DISABLED_AccessibilityEventsTextChanged) { + AccessibilityEventsTextChanged) { RunEventTest(FILE_PATH_LITERAL("text-changed.html")); } diff --git a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc index 84212c6..283d364 100644 --- a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc +++ b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc @@ -703,7 +703,7 @@ IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityDt) { AccessibilityContenteditableDescendants #endif IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, - DISABLED_AccessibilityContenteditableDescendants) { + MAYBE_AccessibilityContenteditableDescendants) { RunHtmlTest(FILE_PATH_LITERAL("contenteditable-descendants.html")); } diff --git a/content/test/data/accessibility/event/text-changed-expected-win.txt b/content/test/data/accessibility/event/text-changed-expected-win.txt index 92c253f..3ef9fa1 100644 --- a/content/test/data/accessibility/event/text-changed-expected-win.txt +++ b/content/test/data/accessibility/event/text-changed-expected-win.txt @@ -2,4 +2,5 @@ EVENT_OBJECT_HIDE on role=ROLE_SYSTEM_STATICTEXT name="Para" IA2_EVENT_TEXT_INSERTED on role=P new_text={'Modified ' start=0 end=9} EVENT_OBJECT_SHOW on role=ROLE_SYSTEM_STATICTEXT name="Modified Para" EVENT_OBJECT_NAMECHANGE on role=ROLE_SYSTEM_STATICTEXT name="Modified Heading" +IA2_EVENT_TEXT_INSERTED on role=ROLE_SYSTEM_STATICTEXT name="Modified Heading" new_text={'Modified ' start=0 end=9} IA2_EVENT_TEXT_INSERTED on role=h2 name="Heading" new_text={'Modified ' start=0 end=9} diff --git a/content/test/data/accessibility/html/contenteditable-descendants-expected-mac.txt b/content/test/data/accessibility/html/contenteditable-descendants-expected-mac.txt index f84f810..327ecc9 100644 --- a/content/test/data/accessibility/html/contenteditable-descendants-expected-mac.txt +++ b/content/test/data/accessibility/html/contenteditable-descendants-expected-mac.txt @@ -1,5 +1,8 @@ AXWebArea -++AXGroup +++AXGroup AXValue='A contenteditable with a link and an and a . +Always expose editable tables as tables. +Editable list item. +' ++++AXGroup ++++++AXStaticText AXValue='A contenteditable with a ' ++++++AXLink AXTitle='link' @@ -16,7 +19,7 @@ AXWebArea ++++++AXColumn ++++++AXGroup ++++AXList -++++++AXGroup +++++++AXGroup AXTitle='Editable list item.' ++++++++AXListMarker AXValue='1' ++++++++AXStaticText AXValue='Editable list item.' ++AXGroup diff --git a/content/test/data/accessibility/html/contenteditable-descendants-expected-win.txt b/content/test/data/accessibility/html/contenteditable-descendants-expected-win.txt index 634ea15..f3b9d23 100644 --- a/content/test/data/accessibility/html/contenteditable-descendants-expected-win.txt +++ b/content/test/data/accessibility/html/contenteditable-descendants-expected-win.txt @@ -5,9 +5,9 @@ ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE ia2_hypertext='<obj0><obj1><obj2>' ++++++ROLE_SYSTEM_LINK name='link' LINKED IA2_STATE_EDITABLE ia2_hypertext='link' ++++++++ROLE_SYSTEM_STATICTEXT name='link' LINKED IA2_STATE_EDITABLE ia2_hypertext='link' ++++++ROLE_SYSTEM_STATICTEXT name=' and an ' IA2_STATE_EDITABLE ia2_hypertext=' and an ' -++++++ROLE_SYSTEM_GRAPHIC name='Image' IA2_STATE_EDITABLE +++++++ROLE_SYSTEM_GRAPHIC name='Image' IA2_STATE_EDITABLE ia2_hypertext='Image' ++++++ROLE_SYSTEM_STATICTEXT name=' and a ' IA2_STATE_EDITABLE ia2_hypertext=' and a ' -++++++ROLE_SYSTEM_PUSHBUTTON name='Button' FOCUSABLE IA2_STATE_EDITABLE +++++++ROLE_SYSTEM_PUSHBUTTON name='Button' FOCUSABLE IA2_STATE_EDITABLE ia2_hypertext='Button' ++++++ROLE_SYSTEM_STATICTEXT name='.' IA2_STATE_EDITABLE ia2_hypertext='.' ++++ROLE_SYSTEM_TABLE IA2_STATE_EDITABLE ia2_hypertext='<obj0><obj1><obj2>' ++++++ROLE_SYSTEM_ROW IA2_STATE_EDITABLE ia2_hypertext='<obj0>' @@ -17,7 +17,7 @@ ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE ia2_hypertext='<obj0><obj1><obj2>' ++++++IA2_ROLE_SECTION IA2_STATE_EDITABLE ++++ROLE_SYSTEM_LIST IA2_STATE_EDITABLE ia2_hypertext='<obj0>' ++++++ROLE_SYSTEM_LISTITEM name='Editable list item.' IA2_STATE_EDITABLE ia2_hypertext='<obj0>Editable list item.' -++++++++ROLE_SYSTEM_STATICTEXT name='1' +++++++++ROLE_SYSTEM_STATICTEXT name='1' ia2_hypertext='1' ++++++++ROLE_SYSTEM_STATICTEXT name='Editable list item.' IA2_STATE_EDITABLE ia2_hypertext='Editable list item.' ++IA2_ROLE_PARAGRAPH ia2_hypertext='Non-editable paragraph.' ++++ROLE_SYSTEM_STATICTEXT name='Non-editable paragraph.' ia2_hypertext='Non-editable paragraph.' |