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

Side by Side Diff: sky/tests/layout/document-elementFromPoint.sky

Issue 926823004: Increase code coverage for RenderLayer::hitTestLayer. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 <sky> 1 <sky>
2 <style> 2 <style>
3 foo, parent { width: 100px; height: 100px; background: blue; } 3 foo, parent { width: 100px; height: 100px; background: blue; }
4 bar { width: 100px; height: 100px; background: purple; } 4 bar { width: 100px; height: 100px; background: purple; }
5 parent { display: paragraph; } 5 parent { display: paragraph; }
6 child { background: salmon; } 6 child { background: salmon; }
7 canvas { height: 50px; background-color: pink; }
7 </style> 8 </style>
8 <foo /><bar /> 9 <foo /><bar />
9 <parent> 10 <parent>
10 <child>Foo bar</child> 11 <child>Foo bar</child>
11 </parent> 12 </parent>
13 <canvas />
12 <script> 14 <script>
13 import "../resources/third_party/unittest/unittest.dart"; 15 import "../resources/third_party/unittest/unittest.dart";
14 import "../resources/unit.dart"; 16 import "../resources/unit.dart";
15 17
16 import "dart:sky"; 18 import "dart:sky";
17 19
18 void main() { 20 void main() {
19 initUnit(); 21 initUnit();
20 22
21 test("should hit test", () { 23 test("should hit test", () {
(...skipping 19 matching lines...) Expand all
41 } 43 }
42 44
43 test("should hit test child and parent", () { 45 test("should hit test child and parent", () {
44 hitTestWithChildren(); 46 hitTestWithChildren();
45 }); 47 });
46 48
47 test("should hit test child with layered parent", () { 49 test("should hit test child with layered parent", () {
48 document.querySelector('parent').style.setProperty("transform", "translate3d (0, 0, 0)"); 50 document.querySelector('parent').style.setProperty("transform", "translate3d (0, 0, 0)");
49 hitTestWithChildren(); 51 hitTestWithChildren();
50 }); 52 });
53
54 test("should hit test transformed child", () {
55 document.querySelector('child').style.setProperty("transform", "translate3d( 100px, 0, 0)");
56 expect(document.elementFromPoint(50, 210).tagName, equals('parent'));
57 expect(document.elementFromPoint(150, 210).tagName, equals('child'));
58 });
59
60 test("should hit test canvas", () {
61 expect(document.elementFromPoint(50, 310).tagName, equals('canvas'));
62 });
51 } 63 }
52 </script> 64 </script>
53 </sky> 65 </sky>
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderLayer.cpp ('k') | sky/tests/layout/document-elementFromPoint-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698