TESTBED: Add openUrl test in MiscTests
This commit is contained in:
parent
817d831255
commit
737dc91e64
2 changed files with 27 additions and 1 deletions
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include "testbed/misc.h"
|
#include "testbed/misc.h"
|
||||||
#include "common/timer.h"
|
#include "common/timer.h"
|
||||||
|
#include <backends/networking/browser/openurl.h>
|
||||||
|
|
||||||
namespace Testbed {
|
namespace Testbed {
|
||||||
|
|
||||||
|
@ -160,10 +161,34 @@ TestExitStatus MiscTests::testMutexes() {
|
||||||
return kTestFailed;
|
return kTestFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TestExitStatus MiscTests::testOpenUrl() {
|
||||||
|
Common::String info = "Testing openUrl() method.\n"
|
||||||
|
"In this test we'll try to open scummvm.org in your default browser.";
|
||||||
|
|
||||||
|
if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) {
|
||||||
|
Testsuite::logPrintf("Info! Skipping test : openUrl()\n");
|
||||||
|
return kTestSkipped;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Networking::Browser::openUrl("http://scummvm.org/")) {
|
||||||
|
Testsuite::logPrintf("Info! openUrl() says it couldn't open the url (probably not supported on this platform)\n");
|
||||||
|
return kTestFailed;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Testsuite::handleInteractiveInput("Was ScummVM able to open 'http://scummvm.org/' in your default browser?", "Yes", "No", kOptionRight)) {
|
||||||
|
Testsuite::logDetailedPrintf("Error! openUrl() is not working!\n");
|
||||||
|
return kTestFailed;
|
||||||
|
}
|
||||||
|
|
||||||
|
Testsuite::logDetailedPrintf("openUrl() is OK\n");
|
||||||
|
return kTestPassed;
|
||||||
|
}
|
||||||
|
|
||||||
MiscTestSuite::MiscTestSuite() {
|
MiscTestSuite::MiscTestSuite() {
|
||||||
addTest("Datetime", &MiscTests::testDateTime, false);
|
addTest("Datetime", &MiscTests::testDateTime, false);
|
||||||
addTest("Timers", &MiscTests::testTimers, false);
|
addTest("Timers", &MiscTests::testTimers, false);
|
||||||
addTest("Mutexes", &MiscTests::testMutexes, false);
|
addTest("Mutexes", &MiscTests::testMutexes, false);
|
||||||
|
addTest("openUrl", &MiscTests::testOpenUrl, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End of namespace Testbed
|
} // End of namespace Testbed
|
||||||
|
|
|
@ -49,6 +49,7 @@ void criticalSection(void *arg);
|
||||||
TestExitStatus testDateTime();
|
TestExitStatus testDateTime();
|
||||||
TestExitStatus testTimers();
|
TestExitStatus testTimers();
|
||||||
TestExitStatus testMutexes();
|
TestExitStatus testMutexes();
|
||||||
|
TestExitStatus testOpenUrl();
|
||||||
// add more here
|
// add more here
|
||||||
|
|
||||||
} // End of namespace MiscTests
|
} // End of namespace MiscTests
|
||||||
|
@ -69,7 +70,7 @@ public:
|
||||||
return "Misc";
|
return "Misc";
|
||||||
}
|
}
|
||||||
const char *getDescription() const {
|
const char *getDescription() const {
|
||||||
return "Miscellaneous: Timers/Mutexes/Datetime";
|
return "Miscellaneous: Timers/Mutexes/Datetime/openUrl";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue