aboutsummaryrefslogtreecommitdiff
path: root/engines/testbed
diff options
context:
space:
mode:
authorAlexander Tkachev2016-07-18 13:05:24 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commit721ee9527e9ff8d028aa0ba70fb4e4c80f7e6060 (patch)
treef7223c44d2dd512c028115d784909bbb57ad668b /engines/testbed
parent4a0a5af52ef4a9c184f8aa49b191e78ed24b5b92 (diff)
downloadscummvm-rg350-721ee9527e9ff8d028aa0ba70fb4e4c80f7e6060.tar.gz
scummvm-rg350-721ee9527e9ff8d028aa0ba70fb4e4c80f7e6060.tar.bz2
scummvm-rg350-721ee9527e9ff8d028aa0ba70fb4e4c80f7e6060.zip
TESTBED: Fix CloudTests to ask users whether to wait
Callbacks might be slow (like in SyncSaves), but they also could hang forever, so users now are being asked whether they want to wait or to skip the test.
Diffstat (limited to 'engines/testbed')
-rw-r--r--engines/testbed/cloud.cpp21
-rw-r--r--engines/testbed/cloud.h1
2 files changed, 17 insertions, 5 deletions
diff --git a/engines/testbed/cloud.cpp b/engines/testbed/cloud.cpp
index 655e2f72bc..73b0b8b5c1 100644
--- a/engines/testbed/cloud.cpp
+++ b/engines/testbed/cloud.cpp
@@ -66,6 +66,17 @@ bool CloudTests::waitForCallback() {
return false;
}
+bool CloudTests::waitForCallbackMore() {
+ while (!waitForCallback()) {
+ Common::String info = "It takes more time than expected. Do you want to skip the test or wait more?";
+ if (Testsuite::handleInteractiveInput(info, "Wait", "Skip", kOptionRight)) {
+ Testsuite::logPrintf("Info! Skipping test : info()\n");
+ return false;
+ }
+ }
+ return true;
+}
+
void CloudTests::infoCallback(Cloud::Storage::StorageInfoResponse response) {
ConfParams.setCloudTestCallbackCalled(true);
Testsuite::logPrintf("Info! User's ID: %s\n", response.value.uid().c_str());
@@ -147,7 +158,7 @@ TestExitStatus CloudTests::testInfo() {
Testsuite::logPrintf("Warning! No Request is returned!\n");
}
- waitForCallback();
+ if (!waitForCallbackMore()) return kTestSkipped;
Testsuite::clearScreen();
if (ConfParams.isCloudTestErrorCallbackCalled()) {
@@ -184,7 +195,7 @@ TestExitStatus CloudTests::testDirectoryListing() {
Testsuite::logPrintf("Warning! No Request is returned!\n");
}
- waitForCallback();
+ if (!waitForCallbackMore()) return kTestSkipped;
Testsuite::clearScreen();
if (ConfParams.isCloudTestErrorCallbackCalled()) {
@@ -226,7 +237,7 @@ TestExitStatus CloudTests::testDirectoryCreating() {
Testsuite::logPrintf("Warning! No Request is returned!\n");
}
- waitForCallback();
+ if (!waitForCallbackMore()) return kTestSkipped;
Testsuite::clearScreen();
if (ConfParams.isCloudTestErrorCallbackCalled()) {
@@ -245,7 +256,7 @@ TestExitStatus CloudTests::testDirectoryCreating() {
Testsuite::logPrintf("Warning! No Request is returned!\n");
}
- waitForCallback();
+ if (!waitForCallbackMore()) return kTestSkipped;
Testsuite::clearScreen();
if (ConfParams.isCloudTestErrorCallbackCalled()) {
@@ -264,7 +275,7 @@ TestExitStatus CloudTests::testDirectoryCreating() {
Testsuite::logPrintf("Warning! No Request is returned!\n");
}
- waitForCallback();
+ if (!waitForCallbackMore()) return kTestSkipped;
Testsuite::clearScreen();
if (ConfParams.isCloudTestErrorCallbackCalled()) {
diff --git a/engines/testbed/cloud.h b/engines/testbed/cloud.h
index 827b231ea5..17bc0938c9 100644
--- a/engines/testbed/cloud.h
+++ b/engines/testbed/cloud.h
@@ -35,6 +35,7 @@ namespace CloudTests {
// Helper functions for Cloud tests
bool waitForCallback();
+bool waitForCallbackMore();
void infoCallback(Cloud::Storage::StorageInfoResponse response);
void directoryListedCallback(Cloud::Storage::FileArrayResponse response);
void directoryCreatedCallback(Cloud::Storage::BoolResponse response);