summaryrefslogtreecommitdiffstats
path: root/tests/auto/qmediacontent/tst_qmediacontent.cpp
diff options
context:
space:
mode:
authorNicholas Young <nicholas.young@nokia.com>2010-02-23 03:32:23 (GMT)
committerNicholas Young <nicholas.young@nokia.com>2010-02-23 03:32:23 (GMT)
commitf56a36d771bb71fe6d0f7025ae427a76a1d22324 (patch)
treec1e6d120b91d60a29c19faab277202a2480a958a /tests/auto/qmediacontent/tst_qmediacontent.cpp
parent0a83a6c571fadb454cb8711aed84258b061d44b5 (diff)
downloadQt-f56a36d771bb71fe6d0f7025ae427a76a1d22324.zip
Qt-f56a36d771bb71fe6d0f7025ae427a76a1d22324.tar.gz
Qt-f56a36d771bb71fe6d0f7025ae427a76a1d22324.tar.bz2
Added QNetworkRequest constructor to QMediaContent.
Now consistent with QMediaResource. Reviewed-by: Dmytro Poplavskiy
Diffstat (limited to 'tests/auto/qmediacontent/tst_qmediacontent.cpp')
-rw-r--r--tests/auto/qmediacontent/tst_qmediacontent.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qmediacontent/tst_qmediacontent.cpp b/tests/auto/qmediacontent/tst_qmediacontent.cpp
index 35dd0a9..8987241 100644
--- a/tests/auto/qmediacontent/tst_qmediacontent.cpp
+++ b/tests/auto/qmediacontent/tst_qmediacontent.cpp
@@ -51,6 +51,7 @@ class tst_QMediaContent : public QObject
private slots:
void testNull();
void testUrlCtor();
+ void testRequestCtor();
void testResourceCtor();
void testResourceListCtor();
void testCopy();
@@ -77,6 +78,18 @@ void tst_QMediaContent::testUrlCtor()
QCOMPARE(media.canonicalResource().url(), QUrl("http://example.com/movie.mov"));
}
+void tst_QMediaContent::testRequestCtor()
+{
+ QNetworkRequest request(QUrl("http://example.com/movie.mov"));
+ request.setAttribute(QNetworkRequest::User, QVariant(1234));
+
+ QMediaContent media(request);
+
+ QCOMPARE(media.canonicalUrl(), QUrl("http://example.com/movie.mov"));
+ QCOMPARE(media.canonicalResource().request(), request);
+ QCOMPARE(media.canonicalResource().url(), QUrl("http://example.com/movie.mov"));
+}
+
void tst_QMediaContent::testResourceCtor()
{
QMediaContent media(QMediaResource(QUrl("http://example.com/movie.mov")));