repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 42f8fdcbcc80778b6b5cb7193dbcca4ac8c02520:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 42f8fdcbcc80778b6b5cb7193dbcca4ac8c02520
Author: James Baicoianu 
Date:   Tue May 31 13:45:07 2016 -0700

    test screenshot uploading

diff --git a/tests/janusweb.test.js b/tests/janusweb.test.js
index ca68c9abe6b2c6a533fe1131f9d418b0dda9b513..
index ..ae48c881c76e59c1dcb32690cb18dcaefb25f9d8 100644
--- a/tests/janusweb.test.js
+++ b/tests/janusweb.test.js
@@ -60,12 +60,30 @@ describe("JanusWeb", function() {
       done();
     });
   });
-/*
   it('takes a screenshot', function(done) {
     setTimeout(function() {
       expect(canvas).toBeDefined();
       var shot = canvas.toDataURL('image/png');

+      elation.net.post('https://api.imgur.com/3/upload.json', 
+        {
+          type: 'base64',
+          name: 'testscreenshot.png',
+          title: 'Test Screenshot',
+          image: shot.split(',')[1]
+        }, 
+        {
+          headers: {
+            Authorization: 'Client-ID 3c6bb1075f20701'
+          },
+          callback: function(data) {
+            var json = JSON.parse(data);
+            console.log('UPLOAD SUCCESS', json.data.link);
+            setTimeout( done, 1000);
+          }
+        });
+
+/*
       var newimg = new Image();
       newimg.src = shot;
       newimg.crossOrigin = '';
@@ -79,8 +97,8 @@ describe("JanusWeb", function() {
         expect(diff).toBe(true);
         done();
       });
+*/
     }, 5000);
   });
-*/

 });

-----END OF PAGE-----