(self, extra)
| 5658 | 'strict': ('"use strict";',), |
| 5659 | }) |
| 5660 | def test_binary_encode(self, extra): |
| 5661 | # Encode values 0 .. 65535 into test data |
| 5662 | test_data = bytearray(struct.pack('<' + 'H' * 65536, *range(65536))) |
| 5663 | write_binary('data.tmp', test_data) |
| 5664 | binary_encoded = binary_encode('data.tmp') |
| 5665 | |
| 5666 | write_file('test.html', '''<!DOCTYPE html><html><head><meta charset="utf-8"></head><body><script> |
| 5667 | ''' + extra + '\n' + read_file(path_from_root('src/binaryDecode.js')) + ''' |
| 5668 | var src = ''' + binary_encoded + '''; |
| 5669 | var u16 = new Uint16Array(binaryDecode(src).buffer); |
| 5670 | for(var i = 0; i < 65536; ++i) |
| 5671 | if (u16[i] != i) throw i; |
| 5672 | console.log('OK'); |
| 5673 | fetch('report_result?0'); |
| 5674 | </script></body></html> |
| 5675 | ''') |
| 5676 | |
| 5677 | self.run_browser('test.html', '/report_result?0') |
| 5678 | |
| 5679 | @parameterized({ |
| 5680 | '': ([],), |
nothing calls this directly
no test coverage detected