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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 var allTests = [
6 function testHitTest() {
7 var buttons = rootNode.findAll({ role: RoleType.BUTTON });
8 var button1 = buttons[0];
9 assertEq(button1.name, 'Hit Test 1');
10 var x = button1.location.left + button1.location.width / 2;
11 var y = button1.location.top + button1.location.height / 2;
12 var button2 = buttons[1];
13 assertEq(button2.name, 'Hit Test 2');
14 var webArea = button1.parent;
15 while (webArea.role != RoleType.ROOT_WEB_AREA)
16 webArea = webArea.parent;
17 button1.addEventListener(EventType.HOVER, function() {
18 x = button2.location.left + button2.location.width / 2;
19 y = button2.location.top + button2.location.height / 2;
20 button2.addEventListener(EventType.ALERT, function() {
21 chrome.test.succeed();
22 }, true);
23 webArea.hitTest(x, y, EventType.ALERT);
24 }, true);
25 webArea.hitTest(x, y, EventType.HOVER);
26 }
27 ];
28
29 setUpAndRunTests(allTests, 'hit_test.html');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698