[rygel] tests: Byte seek fixed-length GstResponse
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] tests: Byte seek fixed-length GstResponse
- Date: Fri, 1 Apr 2011 15:57:34 +0000 (UTC)
commit f8aef6ac38d3e54bd5c942fc870e7ea880b8c1ba
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Wed Mar 30 18:10:16 2011 +0300
tests: Byte seek fixed-length GstResponse
tests/rygel-http-gst-response-test.vala | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/tests/rygel-http-gst-response-test.vala b/tests/rygel-http-gst-response-test.vala
index 70725a8..734e72b 100644
--- a/tests/rygel-http-gst-response-test.vala
+++ b/tests/rygel-http-gst-response-test.vala
@@ -61,9 +61,17 @@ public class Rygel.HTTPGstResponseTest : Rygel.HTTPResponseTest {
internal override HTTPResponse create_response (Soup.Message msg)
throws Error {
+ var seek = null as HTTPSeek;
+
+ if (!this.item.is_live_stream ()) {
+ seek = new HTTPByteSeek (0, HTTPResponseTest.MAX_BYTES - 1);
+ msg.response_headers.set_content_length (seek.length);
+ }
+
var request = new HTTPGet (this.server.context.server,
msg,
this.item,
+ seek,
this.cancellable);
var handler = new HTTPGetHandler (this.cancellable);
@@ -84,10 +92,12 @@ public class Rygel.HTTPGet : GLib.Object {
public HTTPGet (Soup.Server server,
Soup.Message msg,
MediaItem item,
+ HTTPSeek? seek,
Cancellable? cancellable) {
this.server = server;
this.msg = msg;
this.item = item;
+ this.seek = seek;
this.cancellable = cancellable;
}
}
@@ -129,6 +139,11 @@ public class Rygel.MediaItem {
}
}
+internal class Rygel.HTTPByteSeek : Rygel.HTTPSeek {
+ public HTTPByteSeek (int64 start, int64 stop) {
+ base (start, stop);
+ }
+}
internal class Rygel.HTTPTimeSeek : Rygel.HTTPSeek {
public HTTPTimeSeek (int64 start, int64 stop) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]