Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2021-08-24 15:56:04 +0300
committerHannah von Reth <vonreth@kde.org>2021-08-24 19:56:07 +0300
commit43148d0c3ba7f7857c590e7819ea699b84fd2733 (patch)
tree329566cd58991f129d094d33bae9c696b7f3bc70 /test
parentfd928269beb5d50699e5dd924890caeed8118d30 (diff)
Handle timeout during token refresh
Diffstat (limited to 'test')
-rw-r--r--test/testoauth.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/testoauth.cpp b/test/testoauth.cpp
index a8b0dbaaf..0054d6f13 100644
--- a/test/testoauth.cpp
+++ b/test/testoauth.cpp
@@ -392,6 +392,36 @@ private slots:
} test;
test.test();
}
+
+
+ void testTimeout()
+ {
+ struct Test : OAuthTestCase
+ {
+ QScopedValueRollback<int> rollback;
+
+ Test()
+ : rollback(AbstractNetworkJob::httpTimeout, 1)
+ {
+ localHost = QLatin1String("127.0.0.1");
+ }
+
+ QNetworkReply *statusPhpReply(QNetworkAccessManager::Operation op, const QNetworkRequest &req) override
+ {
+ OC_ASSERT(op == QNetworkAccessManager::GetOperation);
+ return new FakeHangingReply(op, req, fakeQnam);
+ }
+
+ void oauthResult(OAuth::Result result, const QString &user, const QString &token, const QString &refreshToken) override
+ {
+ QCOMPARE(state, StartState);
+ QCOMPARE(result, OAuth::Error);
+ gotAuthOk = true;
+ replyToBrowserOk = true;
+ }
+ } test;
+ test.test();
+ }
};