Commit 68eddc95 authored by Jacobo Aragunde Pérez's avatar Jacobo Aragunde Pérez Committed by Commit Bot

Test alert accessibility event on more bubbles.

This is a follow-up to crrev.com/c/2431526, where we fixed the "save
card" and "translate page" bubbles as a side-effect. Now we add some
tests to prevent future regressions in these bubbles.

Bug: 1119349, 1119367, 1119734
Change-Id: I6e78e4aa1f5377d8512d574ae8deaa0437e51f67
AX-relnotes: Announce "save card" and "translate page" alert dialogs.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2460886Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Reviewed-by: default avatarWei Li <weili@chromium.org>
Reviewed-by: default avatarAaron Leventhal <aleventhal@chromium.org>
Commit-Queue: Jacobo Aragunde Pérez <jaragunde@igalia.com>
Cr-Commit-Position: refs/heads/master@{#815626}
parent 0b21d806
...@@ -966,6 +966,17 @@ IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTest, ...@@ -966,6 +966,17 @@ IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTest,
} }
#endif #endif
IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTest,
AlertAccessibleEvent) {
views::test::AXEventCounter counter(views::AXEventManager::Get());
EXPECT_EQ(0, counter.GetCount(ax::mojom::Event::kAlert));
FillForm();
SubmitFormAndWaitForCardLocalSaveBubble();
EXPECT_EQ(1, counter.GetCount(ax::mojom::Event::kAlert));
}
// Tests the sign in promo bubble. Ensures that signin action is recorded when // Tests the sign in promo bubble. Ensures that signin action is recorded when
// user accepts promo. // user accepts promo.
#if BUILDFLAG(ENABLE_DICE_SUPPORT) #if BUILDFLAG(ENABLE_DICE_SUPPORT)
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "ui/base/ui_base_features.h" #include "ui/base/ui_base_features.h"
#include "ui/events/keycodes/dom/dom_code.h" #include "ui/events/keycodes/dom/dom_code.h"
#include "ui/views/controls/button/menu_button.h" #include "ui/views/controls/button/menu_button.h"
#include "ui/views/test/ax_event_counter.h"
namespace translate { namespace translate {
...@@ -131,4 +132,16 @@ IN_PROC_BROWSER_TEST_F(TranslateBubbleViewBrowserTest, ...@@ -131,4 +132,16 @@ IN_PROC_BROWSER_TEST_F(TranslateBubbleViewBrowserTest,
false); false);
} }
IN_PROC_BROWSER_TEST_F(TranslateBubbleViewBrowserTest, AlertAccessibleEvent) {
views::test::AXEventCounter counter(views::AXEventManager::Get());
EXPECT_EQ(0, counter.GetCount(ax::mojom::Event::kAlert));
GURL french_url = ui_test_utils::GetTestUrl(
base::FilePath(), base::FilePath(FILE_PATH_LITERAL("french_page.html")));
NavigateAndWaitForLanguageDetection(french_url, "fr");
// TODO(crbug.com/1082217): This should produce one event instead of two.
EXPECT_LT(0, counter.GetCount(ax::mojom::Event::kAlert));
}
} // namespace translate } // namespace translate
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment