|
|
|
|
@ -16,9 +16,21 @@ |
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
* ============================================================ */ |
|
|
|
|
#include "cookiestest.h" |
|
|
|
|
#include "cookiejar.h" |
|
|
|
|
#include "settings.h" |
|
|
|
|
|
|
|
|
|
#include <QtTest/QtTest> |
|
|
|
|
#include <QDir> |
|
|
|
|
|
|
|
|
|
void CookiesTest::initTestCase() |
|
|
|
|
{ |
|
|
|
|
Settings::createSettings(QDir::tempPath() + "/QupZilla-test.ini"); |
|
|
|
|
m_cookieJar = new CookieJar_Tst; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void CookiesTest::cleanupTestCase() |
|
|
|
|
{ |
|
|
|
|
delete m_cookieJar; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void CookiesTest::domainMatchingTest_data() |
|
|
|
|
{ |
|
|
|
|
@ -50,7 +62,7 @@ void CookiesTest::domainMatchingTest() |
|
|
|
|
QFETCH(QString, siteDomain); |
|
|
|
|
QFETCH(bool, result); |
|
|
|
|
|
|
|
|
|
QCOMPARE(CookieJar::matchDomain(cookieDomain, siteDomain), result); |
|
|
|
|
QCOMPARE(m_cookieJar->matchDomain(cookieDomain, siteDomain), result); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void CookiesTest::listMatchesDomainTest_data() |
|
|
|
|
@ -82,5 +94,5 @@ void CookiesTest::listMatchesDomainTest() |
|
|
|
|
QFETCH(QString, cookieDomain); |
|
|
|
|
QFETCH(bool, result); |
|
|
|
|
|
|
|
|
|
QCOMPARE(CookieJar::listMatchesDomain(list, cookieDomain), result); |
|
|
|
|
QCOMPARE(m_cookieJar->listMatchesDomain(list, cookieDomain), result); |
|
|
|
|
} |
|
|
|
|
|