src/Builder4/FakeServer.vala
authorAlan Knowles <alan@roojs.com>
Thu, 5 Mar 2015 14:36:41 +0000 (22:36 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 5 Mar 2015 14:36:41 +0000 (22:36 +0800)
src/Builder4/FakeServer.vala

index c9e8138..4914436 100644 (file)
@@ -62,6 +62,16 @@ public class FakeServer : Object
         request.set_uri("x"+ uri);
            
     }
-    
+    public void serve(Webkit.URISchemeRequest request)
+    { 
+                        // request is URISchemeRequest    
+               var  file = File.new_for_path ("my-test.bin");
+               var stream = file.read();
+               var info = file.query_info(
+                               GLib.FileAttributes.STANDARD_SIZE,
+                               FileQueryInfoFlags.NONE
+               );
+               
+               request.finish (InputStream stream, int64 stream_length, string? mime_type)
                
 }