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

Unified Diff: chrome/test/data/extensions/api_test/automation/tests/tabs/hit_test.js

Issue 2748463003: Generalize the HIT_TEST accessibility action so that it can send any event. (Closed)
Patch Set: Use ParseAXEvent 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: chrome/test/data/extensions/api_test/automation/tests/tabs/hit_test.js
diff --git a/chrome/test/data/extensions/api_test/automation/tests/tabs/hit_test.js b/chrome/test/data/extensions/api_test/automation/tests/tabs/hit_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..0d40877513062a742739c9d775b61b458b18ec2e
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/automation/tests/tabs/hit_test.js
@@ -0,0 +1,29 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var allTests = [
+ function testHitTest() {
+ var buttons = rootNode.findAll({ role: RoleType.BUTTON });
+ var button1 = buttons[0];
+ assertEq(button1.name, 'Hit Test 1');
+ var x = button1.location.left + button1.location.width / 2;
+ var y = button1.location.top + button1.location.height / 2;
+ var button2 = buttons[1];
+ assertEq(button2.name, 'Hit Test 2');
+ var webArea = button1.parent;
+ while (webArea.role != RoleType.ROOT_WEB_AREA)
+ webArea = webArea.parent;
+ button1.addEventListener(EventType.HOVER, function() {
+ x = button2.location.left + button2.location.width / 2;
+ y = button2.location.top + button2.location.height / 2;
+ button2.addEventListener(EventType.ALERT, function() {
+ chrome.test.succeed();
+ }, true);
+ webArea.hitTest(x, y, EventType.ALERT);
+ }, true);
+ webArea.hitTest(x, y, EventType.HOVER);
+ }
+];
+
+setUpAndRunTests(allTests, 'hit_test.html');

Powered by Google App Engine
This is Rietveld 408576698