[Checkins] SVN: zc.testbrowser/trunk/ - make the (still alpha) screen shot code work better when the browser window

Benji York benji at zope.com
Fri Oct 19 09:38:30 EDT 2007


Log message for revision 80934:
  - make the (still alpha) screen shot code work better when the browser window
    is too small to display the entire page
  - add some todo items
  - set timeout to reasonable value
  

Changed:
  U   zc.testbrowser/trunk/TODO.txt
  U   zc.testbrowser/trunk/src/zc/testbrowser/real.js
  U   zc.testbrowser/trunk/src/zc/testbrowser/real.py

-=-
Modified: zc.testbrowser/trunk/TODO.txt
===================================================================
--- zc.testbrowser/trunk/TODO.txt	2007-10-19 09:59:21 UTC (rev 80933)
+++ zc.testbrowser/trunk/TODO.txt	2007-10-19 13:38:29 UTC (rev 80934)
@@ -7,3 +7,5 @@
     zc.testbrowser a namespace package
 rework tests to be more documenty
 mention the pattern of instantiating the browser object outside the doctest
+file upload controls don't actually do anything
+I /think/ looking up controls via labels isn't quite right; need a test case

Modified: zc.testbrowser/trunk/src/zc/testbrowser/real.js
===================================================================
--- zc.testbrowser/trunk/src/zc/testbrowser/real.js	2007-10-19 09:59:21 UTC (rev 80933)
+++ zc.testbrowser/trunk/src/zc/testbrowser/real.js	2007-10-19 13:38:29 UTC (rev 80934)
@@ -105,11 +105,15 @@
     // The `subject` is what we want to take a screen shot of.
     var subject = content.document;
     var canvas = content.document.createElement('canvas');
-    canvas.width = subject.width;
-    canvas.height = subject.height;
 
+    var height = content.innerHeight + content.scrollMaxY;
+    var width = content.innerWidth + content.scrollMaxX;
+
+    canvas.width = width;
+    canvas.height = height;
+
     var ctx = canvas.getContext('2d');
-    ctx.drawWindow(content, 0, 0, subject.width, subject.height, 'rgb(0,0,0)');
+    ctx.drawWindow(content, 0, 0, width, height, 'rgb(0,0,0)');
     tb_save_canvas(canvas, out_path);
 }
 
@@ -561,4 +565,3 @@
     }
     return tokens;
 }
-

Modified: zc.testbrowser/trunk/src/zc/testbrowser/real.py
===================================================================
--- zc.testbrowser/trunk/src/zc/testbrowser/real.py	2007-10-19 09:59:21 UTC (rev 80933)
+++ zc.testbrowser/trunk/src/zc/testbrowser/real.py	2007-10-19 13:38:29 UTC (rev 80934)
@@ -94,7 +94,7 @@
     base = None
     raiseHttpErrors = True
     _counter = 0
-    timeout = 5 # XXX debug only, change back to 60
+    timeout = 60
 
     def __init__(self, url=None, host='localhost', port=4242):
         self.js = JSProxy(self.execute)



More information about the Checkins mailing list