equal
deleted
inserted
replaced
38 ** $QT_END_LICENSE$ |
38 ** $QT_END_LICENSE$ |
39 ** |
39 ** |
40 ****************************************************************************/ |
40 ****************************************************************************/ |
41 |
41 |
42 #include <QtTest/QtTest> |
42 #include <QtTest/QtTest> |
|
43 #include <QtNetwork/qnetworkrequest.h> |
43 |
44 |
44 #include <qmediacontent.h> |
45 #include <qmediacontent.h> |
45 |
46 |
46 QTM_USE_NAMESPACE |
47 QTM_USE_NAMESPACE |
47 class tst_QMediaContent : public QObject |
48 class tst_QMediaContent : public QObject |
49 Q_OBJECT |
50 Q_OBJECT |
50 |
51 |
51 private slots: |
52 private slots: |
52 void testNull(); |
53 void testNull(); |
53 void testUrlCtor(); |
54 void testUrlCtor(); |
|
55 void testRequestCtor(); |
54 void testResourceCtor(); |
56 void testResourceCtor(); |
55 void testResourceListCtor(); |
57 void testResourceListCtor(); |
56 void testCopy(); |
58 void testCopy(); |
57 void testAssignment(); |
59 void testAssignment(); |
58 void testEquality(); |
60 void testEquality(); |
72 void tst_QMediaContent::testUrlCtor() |
74 void tst_QMediaContent::testUrlCtor() |
73 { |
75 { |
74 QMediaContent media(QUrl("http://example.com/movie.mov")); |
76 QMediaContent media(QUrl("http://example.com/movie.mov")); |
75 |
77 |
76 QCOMPARE(media.canonicalUrl(), QUrl("http://example.com/movie.mov")); |
78 QCOMPARE(media.canonicalUrl(), QUrl("http://example.com/movie.mov")); |
|
79 QCOMPARE(media.canonicalResource().url(), QUrl("http://example.com/movie.mov")); |
|
80 } |
|
81 |
|
82 void tst_QMediaContent::testRequestCtor() |
|
83 { |
|
84 QNetworkRequest request(QUrl("http://example.com/movie.mov")); |
|
85 request.setAttribute(QNetworkRequest::User, QVariant(1234)); |
|
86 |
|
87 QMediaContent media(request); |
|
88 |
|
89 QCOMPARE(media.canonicalUrl(), QUrl("http://example.com/movie.mov")); |
|
90 QCOMPARE(media.canonicalResource().request(), request); |
77 QCOMPARE(media.canonicalResource().url(), QUrl("http://example.com/movie.mov")); |
91 QCOMPARE(media.canonicalResource().url(), QUrl("http://example.com/movie.mov")); |
78 } |
92 } |
79 |
93 |
80 void tst_QMediaContent::testResourceCtor() |
94 void tst_QMediaContent::testResourceCtor() |
81 { |
95 { |