worker_temporaryFileBlob.js 529 B

123456789101112131415161718192021222324252627282930
  1. importScripts('common_temporaryFileBlob.js');
  2. function info(msg) {
  3. postMessage({type: 'info', msg: msg});
  4. }
  5. function ok(a, msg) {
  6. postMessage({type: 'check', what: !!a, msg: msg});
  7. }
  8. function is(a, b, msg) {
  9. ok(a === b, msg);
  10. }
  11. function next() {
  12. postMessage({type: 'finish'});
  13. }
  14. onmessage = function(e) {
  15. if (e.data == 'simple') {
  16. test_simple();
  17. } else if (e.data == 'abort') {
  18. test_abort();
  19. } else if (e.data == 'reuse') {
  20. test_reuse();
  21. } else {
  22. ok(false, 'Something wrong happened');
  23. }
  24. }