add Intel ISA doc as load test, and make harness resilient to bad PDF loads
This commit is contained in:
		
							parent
							
								
									74fad436e4
								
							
						
					
					
						commit
						6ca1c4cf83
					
				
							
								
								
									
										1
									
								
								test/pdfs/intelisa.pdf.link
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								test/pdfs/intelisa.pdf.link
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1 @@
 | 
			
		||||
http://www.intel.com/Assets/PDF/manual/253665.pdf
 | 
			
		||||
@ -14,6 +14,12 @@
 | 
			
		||||
       "rounds": 1,
 | 
			
		||||
       "type": "load"
 | 
			
		||||
    },
 | 
			
		||||
    {  "id": "intelisa-load",
 | 
			
		||||
       "file": "pdfs/intelisa.pdf",
 | 
			
		||||
       "link": true,
 | 
			
		||||
       "rounds": 1,
 | 
			
		||||
       "type": "load"
 | 
			
		||||
    },
 | 
			
		||||
    {  "id": "pdfspec-load",
 | 
			
		||||
       "file": "pdfs/pdf.pdf",
 | 
			
		||||
       "link": true,
 | 
			
		||||
 | 
			
		||||
@ -63,7 +63,14 @@ function nextTask() {
 | 
			
		||||
    if (r.readyState == 4) {
 | 
			
		||||
      var data = r.mozResponseArrayBuffer || r.mozResponse ||
 | 
			
		||||
                 r.responseArrayBuffer || r.response;
 | 
			
		||||
      pdfDoc = new PDFDoc(new Stream(data));
 | 
			
		||||
 | 
			
		||||
      try {
 | 
			
		||||
        pdfDoc = new PDFDoc(new Stream(data));
 | 
			
		||||
      } catch(e) {
 | 
			
		||||
        pdfDoc.numPages = 1;
 | 
			
		||||
        failure = 'load PDF doc: '+ e.toString();
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      currentTask.pageNum = 1, nextPage();
 | 
			
		||||
    }    
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user