[rygel] tests: Fix for recent modifications
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] tests: Fix for recent modifications
- Date: Sun, 8 Feb 2015 13:25:53 +0000 (UTC)
commit 9c6aad4bf0b5d69809a7393f8da18e95c7bbf2d6
Author: Jens Georg <mail jensge org>
Date: Sun Dec 7 16:10:41 2014 +0100
tests: Fix for recent modifications
tests/rygel-http-byte-seek-test.vala | 2 +
tests/rygel-http-get-test.vala | 47 ++++++++++++++++++++++++++-------
tests/rygel-http-item-uri-test.vala | 16 ++++++++---
tests/rygel-http-post-test.vala | 8 ++++++
tests/rygel-http-time-seek-test.vala | 2 +
5 files changed, 61 insertions(+), 14 deletions(-)
---
diff --git a/tests/rygel-http-byte-seek-test.vala b/tests/rygel-http-byte-seek-test.vala
index dd6329a..f9ed46d 100644
--- a/tests/rygel-http-byte-seek-test.vala
+++ b/tests/rygel-http-byte-seek-test.vala
@@ -26,6 +26,8 @@ private errordomain Rygel.TestError {
}
private class Rygel.HTTPIdentityHandler : GLib.Object {}
+private class Rygel.HTTPSubtitleHandler : GLib.Object {}
+private class Rygel.HTTPThumbnailHandler : GLib.Object {}
public class Rygel.MediaObject : GLib.Object {
public int64 size = 2048;
diff --git a/tests/rygel-http-get-test.vala b/tests/rygel-http-get-test.vala
index 0d04bc5..a26328e 100644
--- a/tests/rygel-http-get-test.vala
+++ b/tests/rygel-http-get-test.vala
@@ -146,15 +146,6 @@ public class Rygel.HTTPGetTest : GLib.Object {
requests.add (new TestRequestFactory (request, Soup.Status.OK));
request = new Soup.Message ("GET", this.server.uri);
- request.request_headers.append ("transferMode.dlna.org", "Streaming");
- requests.add (new TestRequestFactory (request, Soup.Status.OK));
-
- request = new Soup.Message ("GET", this.server.uri);
- request.request_headers.append ("transferMode.dlna.org", "Interactive");
- requests.add (new TestRequestFactory (request,
- Soup.Status.NOT_ACCEPTABLE));
-
- request = new Soup.Message ("GET", this.server.uri);
request.request_headers.append ("Range", "bytes=1-2");
requests.add (new TestRequestFactory (request,
Soup.Status.OK));
@@ -364,10 +355,25 @@ public class Rygel.MediaContainer : Rygel.MediaObject {
}
internal abstract class Rygel.HTTPGetHandler {
+ private MediaObject object;
+
public HTTPResponse render_body (HTTPGet get_request) {
+ this.object = get_request.object;
return new HTTPResponse (get_request);
}
+ public string get_default_transfer_mode () {
+ return "Streaming";
+ }
+
+ public bool supports_transfer_mode (string transfer_mode) {
+ return true;
+ }
+
+ public int64 get_resource_size () {
+ return -1;
+ }
+
public void add_response_headers (HTTPGet get_request) {}
public bool knows_size (HTTPGet request) { return false; }
@@ -384,8 +390,21 @@ internal class Rygel.HTTPIdentityHandler : Rygel.HTTPGetHandler {
internal class Rygel.HTTPPlaylistHandler : Rygel.HTTPGetHandler {
public HTTPPlaylistHandler (string? arg, Cancellable cancellable) {}
+}
+
+internal class Rygel.HTTPSubtitleHandler : Rygel.HTTPGetHandler {
+ public HTTPSubtitleHandler (MediaFileItem item, int index, Cancellable
+ cancellable) {}
+}
- public static bool is_supported (string? arg) { return true; }
+internal class Rygel.HTTPThumbnailHandler : Rygel.HTTPGetHandler {
+ public HTTPThumbnailHandler (MediaFileItem item, int index, Cancellable
+ cancellable) {}
+}
+
+internal class Rygel.HTTPMediaResourceHandler : Rygel.HTTPGetHandler {
+ public HTTPMediaResourceHandler (MediaObject object, string resource,
+ Cancellable cancellable) {}
}
public abstract class Rygel.MediaFileItem : Rygel.MediaObject {
@@ -500,9 +519,17 @@ internal class Rygel.HTTPResponse : Rygel.StateMachine, GLib.Object {
}
}
+public class Rygel.MediaResource : GLib.Object {
+ public string extension;
+}
+
public class Rygel.MediaObject {
public string id;
public string mime_type = "";
+
+ public MediaResource? get_resource_by_name (string name) {
+ return null;
+ }
}
public class Rygel.Transcoder : GLib.Object {
diff --git a/tests/rygel-http-item-uri-test.vala b/tests/rygel-http-item-uri-test.vala
index 6028325..a5ed8ba 100644
--- a/tests/rygel-http-item-uri-test.vala
+++ b/tests/rygel-http-item-uri-test.vala
@@ -33,7 +33,7 @@ private errordomain Rygel.TestError {
SKIP
}
-private class Rygel.Transcoder : GLib.Object {
+public class Rygel.Transcoder : GLib.Object {
public string extension { get; protected set; }
public Transcoder (string extension) {
@@ -41,7 +41,7 @@ private class Rygel.Transcoder : GLib.Object {
}
}
-private class Rygel.HTTPServer : GLib.Object {
+public class Rygel.HTTPServer : GLib.Object {
private const string SERVER_PATH = "/Test";
public string path_root { get; private set; }
@@ -72,11 +72,19 @@ private class Rygel.HTTPServer : GLib.Object {
}
}
-private class Rygel.MediaObject : GLib.Object {
+public class Rygel.MediaResource : GLib.Object {
+ public string extension;
+}
+
+public class Rygel.MediaObject : GLib.Object {
public string id;
+
+ public MediaResource? get_resource_by_name (string name) {
+ return null;
+ }
}
-private class Rygel.MediaFileItem : Rygel.MediaObject {
+public class Rygel.MediaFileItem : Rygel.MediaObject {
public ArrayList<string> uris = new ArrayList<string> ();
public string mime_type;
public Gee.ArrayList<string> get_uris () { return this.uris; }
diff --git a/tests/rygel-http-post-test.vala b/tests/rygel-http-post-test.vala
index 25eff3c..e488915 100644
--- a/tests/rygel-http-post-test.vala
+++ b/tests/rygel-http-post-test.vala
@@ -504,10 +504,18 @@ public class Rygel.ObjectRemovalQueue: GLib.Object {
}
}
+public class Rygel.MediaResource : GLib.Object {
+ public string extension;
+}
+
public class Rygel.MediaObject : GLib.Object {
public string id;
public unowned MediaContainer parent;
public string mime_type = "";
+
+ public MediaResource? get_resource_by_name (string name) {
+ return null;
+ }
}
public class Rygel.Thumbnail : GLib.Object {
diff --git a/tests/rygel-http-time-seek-test.vala b/tests/rygel-http-time-seek-test.vala
index 47a6fb5..901b013 100644
--- a/tests/rygel-http-time-seek-test.vala
+++ b/tests/rygel-http-time-seek-test.vala
@@ -26,6 +26,8 @@ private errordomain Rygel.TestError {
}
private class Rygel.HTTPTranscodeHandler : GLib.Object {}
+private class Rygel.HTTPSubtitleHandler : GLib.Object {}
+private class Rygel.HTTPThumbnailHandler : GLib.Object {}
public class Rygel.MediaObject : GLib.Object {
public int64 size = -1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]