| OLD | NEW |
| 1 <sky> | 1 <sky> |
| 2 <import src="../resources/chai.sky" /> | |
| 3 <import src="../resources/mocha.sky" /> | |
| 4 <style> | 2 <style> |
| 5 foo { width: 100px; height: 100px; background: blue; } | 3 foo { width: 100px; height: 100px; background: blue; } |
| 6 bar { width: 100px; height: 100px; background: purple; } | 4 bar { width: 100px; height: 100px; background: purple; } |
| 7 </style> | 5 </style> |
| 8 <foo /><bar /> | 6 <foo /><bar /> |
| 9 <script> | 7 <script> |
| 10 describe("elementFromPoint", function() { | 8 import "../resources/third_party/unittest/unittest.dart"; |
| 11 it("should hit test", function() { | 9 import "../resources/unit.dart"; |
| 10 |
| 11 import "dart:sky"; |
| 12 |
| 13 void main() { |
| 14 initUnit(); |
| 15 |
| 16 test("should hit test", () { |
| 12 // FIXME: We should have much better hit-testing coverage, at least: | 17 // FIXME: We should have much better hit-testing coverage, at least: |
| 13 // inline content (both sections of a wrapped run) | 18 // inline content (both sections of a wrapped run) |
| 14 // text node | 19 // text node |
| 15 // flex box | 20 // flex box |
| 16 // display: paragraph | 21 // display: paragraph |
| 17 // position: absolute | 22 // position: absolute |
| 18 // position: relative | 23 // position: relative |
| 19 // z-order (missing, zero, positive and negative) | 24 // z-order (missing, zero, positive and negative) |
| 20 assert.equal(document.elementFromPoint(50, 50).tagName, 'foo') | 25 expect(document.elementFromPoint(50, 50).tagName, equals('foo')); |
| 21 assert.equal(document.elementFromPoint(50, 150).tagName, 'bar') | 26 expect(document.elementFromPoint(50, 150).tagName, equals('bar')); |
| 22 assert.equal(document.elementFromPoint(50, 250).tagName, 'sky') | 27 expect(document.elementFromPoint(50, 250).tagName, equals('sky')); |
| 23 }); | 28 }); |
| 24 }); | 29 } |
| 25 </script> | 30 </script> |
| 26 </sky> | 31 </sky> |
| OLD | NEW |