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

Unified Diff: content/browser/accessibility/hit_testing_browsertest.cc

Issue 2789963002: Accessible bounds should include device scale factor on Windows (again) (Closed)
Patch Set: Fix const Created 3 years, 9 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: content/browser/accessibility/hit_testing_browsertest.cc
diff --git a/content/browser/accessibility/hit_testing_browsertest.cc b/content/browser/accessibility/hit_testing_browsertest.cc
index 0ea0a861c2e0ba57374616064325984f287232ab..18009a18151daa6a907563b421332e76898b758a 100644
--- a/content/browser/accessibility/hit_testing_browsertest.cc
+++ b/content/browser/accessibility/hit_testing_browsertest.cc
@@ -133,9 +133,6 @@ IN_PROC_BROWSER_TEST_F(AccessibilityHitTestingBrowserTest,
ASSERT_TRUE(hit_node != NULL);
ASSERT_EQ(ui::AX_ROLE_BUTTON, hit_node->GetRole());
ASSERT_EQ("Button", hit_node->GetStringAttribute(ui::AX_ATTR_NAME));
- gfx::Rect bounds = hit_node->GetScreenBoundsRect();
- EXPECT_EQ(250, bounds.width());
- EXPECT_EQ(50, bounds.height());
// (50, 305) -> div in first iframe
hit_node = HitTestAndWaitForResult(gfx::Point(50, 305));
@@ -233,48 +230,4 @@ IN_PROC_BROWSER_TEST_F(AccessibilityHitTestingBrowserTest,
ASSERT_EQ(ui::AX_ROLE_DIV, hit_node->GetRole());
}
-#if defined(OS_WIN)
-IN_PROC_BROWSER_TEST_F(AccessibilityHitTestingBrowserTest,
- HitTestingWithDeviceScaleFactorOnWin) {
- host_resolver()->AddRule("*", "127.0.0.1");
- ASSERT_TRUE(embedded_test_server()->Start());
-
- NavigateToURL(shell(), GURL(url::kAboutBlankURL));
-
- AccessibilityNotificationWaiter waiter(shell()->web_contents(),
- kAccessibilityModeComplete,
- ui::AX_EVENT_LOAD_COMPLETE);
- GURL url(embedded_test_server()->GetURL(
- "/accessibility/html/iframe-coordinates.html"));
- NavigateToURL(shell(), url);
- waiter.WaitForNotification();
-
- WaitForAccessibilityTreeToContainNodeWithName(shell()->web_contents(),
- "Ordinary Button");
- WaitForAccessibilityTreeToContainNodeWithName(shell()->web_contents(),
- "Scrolled Button");
-
- // Set device scale factor to 2.0.
- WebContentsImpl* web_contents =
- static_cast<WebContentsImpl*>(shell()->web_contents());
- BrowserAccessibilityManager* manager =
- web_contents->GetRootBrowserAccessibilityManager();
- manager->UseCustomDeviceScaleFactorForTesting(2.0);
-
- // We're calling the hit test function internally, so the input coordinates
- // should not be transformed, but the resulting object's dimensions should
- // be halved (give or take a pixel due to rounding).
-
- // (50, 50) -> "Button"
- BrowserAccessibility* hovered_node;
- hovered_node = HitTestAndWaitForResult(gfx::Point(50, 50));
- ASSERT_TRUE(hovered_node != NULL);
- ASSERT_EQ(ui::AX_ROLE_BUTTON, hovered_node->GetRole());
- ASSERT_EQ("Button", hovered_node->GetStringAttribute(ui::AX_ATTR_NAME));
- gfx::Rect bounds = hovered_node->GetScreenBoundsRect();
- EXPECT_LE(std::abs(bounds.width() - 125), 1);
- EXPECT_LE(std::abs(bounds.height() - 25), 1);
-}
-#endif // defined(OS_WIN)
-
} // namespace content
« no previous file with comments | « content/browser/accessibility/browser_accessibility_win.cc ('k') | ui/views/accessibility/native_view_accessibility_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698