Permalink
Browse files

Adding tests - blank PDF

  • Loading branch information...
1 parent 0666d67 commit cc07631c71fee57fd79f09dd2803de9afb425612 Daniel Dotsenko committed Feb 20, 2012
Showing with 2,192 additions and 0 deletions.
  1. +136 −0 test/001_blankpdf.txt
  2. +20 −0 test/libs/curl-0.5.4.min.js
  3. +115 −0 test/libs/custom_fill.js
  4. +232 −0 test/libs/qunit.css
  5. +1,632 −0 test/libs/qunit.js
  6. +31 −0 test/test.html
  7. +26 −0 test/tests.js
View
@@ -0,0 +1,136 @@
+%PDF-1.3
+3 0 obj
+<</Type /Page
+/Parent 1 0 R
+/Resources 2 0 R
+/Contents 4 0 R>>
+endobj
+4 0 obj
+<</Length 30>>
+stream
+0.57 w
+0 G
+BT /F1 16.00 Tf ET
+
+endstream
+endobj
+1 0 obj
+<</Type /Pages
+/Kids [3 0 R ]
+/Count 1
+/MediaBox [0 0 595.28 841.89]
+>>
+endobj
+5 0 obj
+<</BaseFont/Helvetica/Type/Font
+/Subtype/Type1>>
+endobj
+6 0 obj
+<</BaseFont/Helvetica-Bold/Type/Font
+/Subtype/Type1>>
+endobj
+7 0 obj
+<</BaseFont/Helvetica-Oblique/Type/Font
+/Subtype/Type1>>
+endobj
+8 0 obj
+<</BaseFont/Helvetica-BoldOblique/Type/Font
+/Subtype/Type1>>
+endobj
+9 0 obj
+<</BaseFont/Courier/Type/Font
+/Subtype/Type1>>
+endobj
+10 0 obj
+<</BaseFont/Courier-Bold/Type/Font
+/Subtype/Type1>>
+endobj
+11 0 obj
+<</BaseFont/Courier-Oblique/Type/Font
+/Subtype/Type1>>
+endobj
+12 0 obj
+<</BaseFont/Courier-BoldOblique/Type/Font
+/Subtype/Type1>>
+endobj
+13 0 obj
+<</BaseFont/Times-Roman/Type/Font
+/Subtype/Type1>>
+endobj
+14 0 obj
+<</BaseFont/Times-Bold/Type/Font
+/Subtype/Type1>>
+endobj
+15 0 obj
+<</BaseFont/Times-Italic/Type/Font
+/Subtype/Type1>>
+endobj
+16 0 obj
+<</BaseFont/Times-BoldItalic/Type/Font
+/Subtype/Type1>>
+endobj
+2 0 obj
+<<
+/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
+/Font <<
+/F1 5 0 R
+/F2 6 0 R
+/F3 7 0 R
+/F4 8 0 R
+/F5 9 0 R
+/F6 10 0 R
+/F7 11 0 R
+/F8 12 0 R
+/F9 13 0 R
+/F10 14 0 R
+/F11 15 0 R
+/F12 16 0 R
+>>
+/XObject <<
+>>
+>>
+endobj
+17 0 obj
+<<
+/Producer (jsPDF 20120127)
+/CreationDate (D:20120218192544)
+>>
+endobj
+18 0 obj
+<<
+/Type /Catalog
+/Pages 1 0 R
+/OpenAction [3 0 R /FitH null]
+/PageLayout /OneColumn
+>>
+endobj
+xref
+0 19
+0000000000 65535 f
+0000000165 00000 n
+0000001082 00000 n
+0000000009 00000 n
+0000000087 00000 n
+0000000252 00000 n
+0000000316 00000 n
+0000000385 00000 n
+0000000457 00000 n
+0000000533 00000 n
+0000000595 00000 n
+0000000663 00000 n
+0000000734 00000 n
+0000000809 00000 n
+0000000876 00000 n
+0000000942 00000 n
+0000001010 00000 n
+0000001306 00000 n
+0000001388 00000 n
+trailer
+<<
+/Size 19
+/Root 18 0 R
+/Info 17 0 R
+>>
+startxref
+1492
+%%EOF

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -0,0 +1,115 @@
+(function(){
+ var window = this
+
+ // logging Shim from HTML5 Boilerplate
+ window.log = function() {
+ log.history = log.history || []; // store logs to an array for reference
+ log.history.push(arguments);
+ if (this.console) {
+ arguments.callee = arguments.callee.caller;
+ var newarr = [].slice.call(arguments);
+ (typeof console.log === 'object' ? log.apply.call(console.log, console, newarr) : console.log.apply(console, newarr));
+ }
+ };
+ // make it safe to use console.log always
+ (function(b) { function c() { } for (var d = "assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,timeStamp,profile,profileEnd,time,timeEnd,trace,warn".split(","), a; a = d.pop(); ) { b[a] = b[a] || c } })((function() {try { console.log(); return window.console; } catch (err) {return window.console = {};}})());
+
+
+
+ // curl.js text! plugin
+ define('text', function () {
+ var progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'],
+ // collection of modules that have been written to the built file
+ built = {};
+
+ function xhr () {
+ if (typeof XMLHttpRequest !== "undefined") {
+ // rewrite the getXhr method to always return the native implementation
+ xhr = function () { return new XMLHttpRequest(); };
+ }
+ else {
+ // keep trying progIds until we find the correct one, then rewrite the getXhr method
+ // to always return that one.
+ var noXhr = xhr = function () {
+ throw new Error("getXhr(): XMLHttpRequest not available");
+ };
+ while (progIds.length > 0 && xhr === noXhr) (function (id) {
+ try {
+ new ActiveXObject(id);
+ xhr = function () { return new ActiveXObject(id); };
+ }
+ catch (ex) {}
+ }(progIds.shift()));
+ }
+ return xhr();
+ }
+
+ function fetchText (url, callback, errback) {
+ var x = xhr();
+ x.open('GET', url, true);
+ x.onreadystatechange = function (e) {
+ if (x.readyState === 4) {
+ if (x.status < 400) {
+ callback(x.responseText);
+ }
+ else {
+ errback(new Error('fetchText() failed. status: ' + x.statusText));
+ }
+ }
+ };
+ x.send(null);
+ }
+
+ function nameWithExt (name, defaultExt) {
+ return name.lastIndexOf('.') <= name.lastIndexOf('/') ?
+ name + '.' + defaultExt : name;
+ }
+
+ function error (ex) {
+ if (console) {
+ console.error ? console.error(ex) : console.log(ex.message);
+ }
+ }
+ function jsEncode (text) {
+ // TODO: hoist the map and regex to the enclosing scope for better performance
+ var map = { 34: '\\"', 13: '\\r', 12: '\\f', 10: '\\n', 9: '\\t', 8: '\\b' };
+ return text.replace(/(["\n\f\t\r\b])/g, function (c) {
+ return map[c.charCodeAt(0)];
+ });
+ }
+ return {
+
+ load: function (resourceName, req, callback, config) {
+ // remove suffixes (future)
+ // hook up callbacks
+ var cb = callback.resolve || callback,
+ eb = callback.reject || error;
+ // get the text
+ fetchText(req['toUrl'](resourceName), cb, eb);
+ },
+
+ build: function (writer, fetcher, config) {
+ // writer is a function used to output to the built file
+ // fetcher is a function used to fetch a text file
+ // config is the global config
+ // returns a function that the build tool can use to tell this
+ // plugin to write-out a resource
+ return function write (pluginId, resource, resolver) {
+ var url, absId, text, output;
+ url = resolver['toUrl'](nameWithExt(resource, 'html'));
+ absId = resolver['toAbsMid'](resource);
+ if (!(absId in built)) {
+ built[absId] = true;
+ // fetch text
+ text = jsEncode(fetcher(url));
+ // write out a define
+ output = 'define("' + pluginId + '!' + absId + '", function () {\n' +
+ '\treturn "' + text + '";\n' +
+ '});\n';
+ writer(output)
+ }
+ }
+ }
+ }
+ })
+}).call(typeof window !== 'undefined'? window : this)
Oops, something went wrong.

0 comments on commit cc07631

Please sign in to comment.