diff options
author | Alexander Tkachev | 2016-07-18 13:05:24 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | 721ee9527e9ff8d028aa0ba70fb4e4c80f7e6060 (patch) | |
tree | f7223c44d2dd512c028115d784909bbb57ad668b /engines/testbed/cloud.cpp | |
parent | 4a0a5af52ef4a9c184f8aa49b191e78ed24b5b92 (diff) | |
download | scummvm-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/cloud.cpp')
-rw-r--r-- | engines/testbed/cloud.cpp | 21 |
1 files changed, 16 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()) { |