OLD | NEW |
---|---|
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
haraken
2014/03/26 13:06:30
You could make this test nicer by including js-tes
Mads Ager (chromium)
2014/03/26 13:18:00
It seems that the way this test is messing with th
haraken
2014/03/26 13:20:19
oh I see, thanks.
| |
2 <html style="display: inline-table"> | 2 <html style="display: inline-table"> |
3 <script> | 3 <script> |
4 if (window.testRunner) | 4 if (window.testRunner) |
5 testRunner.dumpAsText(); | 5 testRunner.dumpAsText(); |
haraken
2014/03/26 13:06:30
You can remove this.
Mads Ager (chromium)
2014/03/26 13:18:00
Yes, but why not dump as text so that it is just a
haraken
2014/03/26 13:20:19
I just meant, if you include js-test.js, it calls
| |
6 | 6 |
7 window.onload = function() { | 7 window.onload = function() { |
8 var selection = window.getSelection(); | 8 var selection = window.getSelection(); |
9 selection.selectAllChildren(document); | 9 selection.selectAllChildren(document); |
10 selection.collapseToEnd(); | 10 selection.collapseToEnd(); |
11 var element = document.activeElement; | 11 var element = document.activeElement; |
12 var parent = element.parentNode; | |
12 document.open(); | 13 document.open(); |
haraken
2014/03/26 13:06:30
I'm not sure if it's needed to open the document t
Mads Ager (chromium)
2014/03/26 13:18:00
This is pretty minimal. It is needed to open the d
| |
13 document.write("Pass. Test didn't crash."); | 14 if (selection.containsNode(element,true)) |
haraken
2014/03/26 13:06:30
You can just write:
shouldBeFalse("selection.co
Mads Ager (chromium)
2014/03/26 13:18:00
Unfortunately, that does not work. Probably becaus
| |
15 document.write("FAIL: selection.containsNode should return false"); | |
16 else | |
17 document.write("PASS"); | |
14 document.close(); | 18 document.close(); |
15 selection.containsNode(element,true); | |
16 } | 19 } |
17 </script> | 20 </script> |
18 </html> | 21 </html> |
OLD | NEW |