Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../resources/testharness.js"></script> | |
| 3 <script src="../../resources/testharnessreport.js"></script> | |
| 4 <script> | |
| 5 | |
| 6 function silentHistogramCount(bucket) | |
| 7 { | |
| 8 try { | |
| 9 return internals.histogramCount("Event.PassiveForcedEventDispatchBreakage", bucket); | |
| 10 } catch(err) { | |
| 11 } | |
| 12 return 0; | |
| 13 } | |
| 14 | |
| 15 test(function() { | |
| 16 window.addEventListener('touchstart', function(e) { | |
| 17 assert_false(e.cancelable); | |
| 18 }, {}); | |
| 19 | |
| 20 var countBefore = silentHistogramCount(0); | |
| 21 window.dispatchEvent(new TouchEvent('touchstart', {cancelable: false})); | |
| 22 assert_equals(countBefore + 1, silentHistogramCount(0)); | |
|
Rick Byers
2016/07/11 14:41:52
nit: rather than use hard-coded bucket values, ple
dtapuska
2016/07/11 15:46:05
Done.
| |
| 23 | |
| 24 }, "Not calling prevent default"); | |
| 25 | |
| 26 test(function() { | |
| 27 window.addEventListener('touchstart', function(e) { | |
| 28 assert_false(e.cancelable); | |
| 29 e.preventDefault(); | |
| 30 }, {}); | |
| 31 | |
| 32 var countBefore = silentHistogramCount(1); | |
| 33 window.dispatchEvent(new TouchEvent('touchstart', {cancelable: false})); | |
| 34 assert_equals(countBefore + 1, silentHistogramCount(1)); | |
| 35 | |
| 36 }, "Caling prevent default"); | |
| 37 | |
| 38 </script> | |
| OLD | NEW |