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

Unified Diff: chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc

Issue 2670003002: Accessibility for Autofill Popup View in native code (Closed)
Patch Set: Switches to CHECK to ensure crash is caught early. Created 3 years, 10 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/browser/ui/autofill/autofill_popup_controller_unittest.cc
diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc b/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc
index a6ef0406f1470abf07411f11d52bf338f4b68616..9521e17f8d15ec680330d9b8e8f6db5a11703930 100644
--- a/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc
+++ b/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc
@@ -26,6 +26,7 @@
#include "content/public/browser/web_contents.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/accessibility/ax_enums.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/text_utils.h"
@@ -96,6 +97,7 @@ class TestAutofillPopupController : public AutofillPopupControllerImpl {
using AutofillPopupControllerImpl::SetValues;
using AutofillPopupControllerImpl::GetWeakPtr;
MOCK_METHOD1(InvalidateRow, void(size_t));
+ MOCK_METHOD2(NotifyAccessibilityEventForRow, void(ui::AXEvent, size_t));
MOCK_METHOD0(UpdateBoundsAndRedrawPopup, void());
MOCK_METHOD0(Hide, void());
@@ -197,15 +199,22 @@ TEST_F(AutofillPopupControllerUnitTest, RedrawSelectedLine) {
// be updated to show it is selected.
int selected_line = 0;
EXPECT_CALL(*autofill_popup_controller_, InvalidateRow(selected_line));
+ EXPECT_CALL(
+ *autofill_popup_controller_,
+ NotifyAccessibilityEventForRow(ui::AX_EVENT_SELECTION, selected_line));
autofill_popup_controller_->SetSelectedLine(selected_line);
// Ensure that the row isn't invalidated if it didn't change.
EXPECT_CALL(*autofill_popup_controller_,
InvalidateRow(selected_line)).Times(0);
+ EXPECT_CALL(*autofill_popup_controller_, NotifyAccessibilityEventForRow(_, _))
+ .Times(0);
autofill_popup_controller_->SetSelectedLine(selected_line);
// Change back to no selection.
EXPECT_CALL(*autofill_popup_controller_, InvalidateRow(selected_line));
+ EXPECT_CALL(*autofill_popup_controller_, NotifyAccessibilityEventForRow(_, _))
+ .Times(0);
autofill_popup_controller_->SetSelectedLine(-1);
}
@@ -254,6 +263,8 @@ TEST_F(AutofillPopupControllerUnitTest, RemoveOnlyLine) {
// should then be hidden since there are no Autofill entries left.
EXPECT_CALL(*autofill_popup_controller_, Hide());
EXPECT_CALL(*autofill_popup_controller_, InvalidateRow(_)).Times(0);
+ EXPECT_CALL(*autofill_popup_controller_, NotifyAccessibilityEventForRow(_, _))
+ .Times(0);
EXPECT_TRUE(autofill_popup_controller_->RemoveSelectedLine());
}
« no previous file with comments | « chrome/browser/ui/autofill/autofill_popup_controller_impl.cc ('k') | chrome/browser/ui/autofill/autofill_popup_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698