diff options
author | Alexander Tkachev | 2016-07-18 17:14:50 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | 737dc91e64c75e7b282e21d278f29705d74ce449 (patch) | |
tree | a78b63491f1b5fa787f5a874250ec24b34f07aee /engines/testbed/misc.cpp | |
parent | 817d831255ad37f82c21ba7f00c4795a536d33fb (diff) | |
download | scummvm-rg350-737dc91e64c75e7b282e21d278f29705d74ce449.tar.gz scummvm-rg350-737dc91e64c75e7b282e21d278f29705d74ce449.tar.bz2 scummvm-rg350-737dc91e64c75e7b282e21d278f29705d74ce449.zip |
TESTBED: Add openUrl test in MiscTests
Diffstat (limited to 'engines/testbed/misc.cpp')
-rw-r--r-- | engines/testbed/misc.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/engines/testbed/misc.cpp b/engines/testbed/misc.cpp index 5847a8d2e4..3dde71e919 100644 --- a/engines/testbed/misc.cpp +++ b/engines/testbed/misc.cpp @@ -22,6 +22,7 @@ #include "testbed/misc.h" #include "common/timer.h" +#include <backends/networking/browser/openurl.h> namespace Testbed { @@ -160,10 +161,34 @@ TestExitStatus MiscTests::testMutexes() { 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() { addTest("Datetime", &MiscTests::testDateTime, false); addTest("Timers", &MiscTests::testTimers, false); addTest("Mutexes", &MiscTests::testMutexes, false); + addTest("openUrl", &MiscTests::testOpenUrl, true); } } // End of namespace Testbed |