diff options
author | Rider Linden <rider@lindenlab.com> | 2015-09-14 11:15:23 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2015-09-14 11:15:23 -0700 |
commit | 97236a42ca08979897d5c7b0826312345754cd67 (patch) | |
tree | 55cf5e5757b23f0bc52eb4a2a7270279d6548480 /indra/newview | |
parent | f2da6ec2ac7299b62b3c11455356c8c2ab5f2b2b (diff) |
MAINT-5507: Remove HTTPClient and related cruft.
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/CMakeLists.txt | 7 | ||||
-rwxr-xr-x | indra/newview/llaisapi.cpp | 2 | ||||
-rwxr-xr-x | indra/newview/llaisapi.h | 1 | ||||
-rwxr-xr-x | indra/newview/llappviewer.cpp | 3 | ||||
-rwxr-xr-x | indra/newview/lleventpoll.h | 1 | ||||
-rw-r--r-- | indra/newview/llfloaterexperienceprofile.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llfloaterexperiences.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/llgroupmgr.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/llmarketplacefunctions.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/llmeshrepository.h | 1 | ||||
-rw-r--r-- | indra/newview/llpanelexperiencepicker.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llpanelgroupexperiences.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/llsecapi.cpp | 41 | ||||
-rwxr-xr-x | indra/newview/llsecapi.h | 3 | ||||
-rwxr-xr-x | indra/newview/llsidepanelinventory.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/llstartup.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/lltranslate.cpp | 22 | ||||
-rwxr-xr-x | indra/newview/lltranslate.h | 2 | ||||
-rwxr-xr-x | indra/newview/lluploadfloaterobservers.h | 1 | ||||
-rwxr-xr-x | indra/newview/llviewermenufile.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/llviewerregion.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/tests/lltranslate_test.cpp | 340 |
22 files changed, 2 insertions, 432 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 7eb4174b7f..af51c6dc36 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2224,7 +2224,6 @@ if (LL_TESTS) # llmediadataclient.cpp lllogininstance.cpp # llremoteparcelrequest.cpp -# lltranslate.cpp llviewerhelputil.cpp llversioninfo.cpp llworldmap.cpp @@ -2245,12 +2244,6 @@ if (LL_TESTS) ${CURL_LIBRARIES} ) -# set_source_files_properties( -# lltranslate.cpp -# PROPERTIES -# LL_TEST_ADDITIONAL_LIBRARIES "${test_libs}" -# ) - set_source_files_properties( llmediadataclient.cpp PROPERTIES diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index da2f69126a..2d877f6a47 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -380,7 +380,7 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); LLCore::HttpHeaders::ptr_t httpHeaders; - httpOptions->setTimeout(HTTP_REQUEST_EXPIRY_SECS); + httpOptions->setTimeout(LLCoreHttpUtil::HTTP_REQUEST_EXPIRY_SECS); LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL; diff --git a/indra/newview/llaisapi.h b/indra/newview/llaisapi.h index 2de8003c2f..48c081991a 100755 --- a/indra/newview/llaisapi.h +++ b/indra/newview/llaisapi.h @@ -32,7 +32,6 @@ #include <set> #include <string> #include "llcurl.h" -#include "llhttpclient.h" #include "llhttpretrypolicy.h" #include "llviewerinventory.h" #include "llcorehttputil.h" diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e13a9d96c7..16dac4a9e5 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1160,8 +1160,6 @@ bool LLAppViewer::init() { LLNotificationsUtil::add("CorruptedProtectedDataStore"); } - LLHTTPClient::setCertVerifyCallback(secapiSSLCertVerifyCallback); - gGLActive = FALSE; @@ -1315,7 +1313,6 @@ bool LLAppViewer::mainLoop() // Create IO Pump to use for HTTP Requests. gServicePump = new LLPumpIO(gAPRPoolp); - LLHTTPClient::setPump(*gServicePump); LLCurl::setCAFile(gDirUtilp->getCAFile()); // Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be instantiated. diff --git a/indra/newview/lleventpoll.h b/indra/newview/lleventpoll.h index e32b4ed322..e2afd9226b 100755 --- a/indra/newview/lleventpoll.h +++ b/indra/newview/lleventpoll.h @@ -27,7 +27,6 @@ #ifndef LL_LLEVENTPOLL_H #define LL_LLEVENTPOLL_H -#include "llhttpclient.h" #include "boost/move/unique_ptr.hpp" namespace boost diff --git a/indra/newview/llfloaterexperienceprofile.cpp b/indra/newview/llfloaterexperienceprofile.cpp index dd1c6dce0a..d44eb4310d 100644 --- a/indra/newview/llfloaterexperienceprofile.cpp +++ b/indra/newview/llfloaterexperienceprofile.cpp @@ -36,7 +36,6 @@ #include "llexpandabletextbox.h" #include "llexperiencecache.h" #include "llfloaterreg.h" -#include "llhttpclient.h" #include "lllayoutstack.h" #include "lllineeditor.h" #include "llnotificationsutil.h" diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index 14fbdb3a8f..bdab9ed868 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -32,7 +32,6 @@ #include "llevents.h" #include "llexperiencecache.h" #include "llfloaterregioninfo.h" -#include "llhttpclient.h" #include "llnotificationsutil.h" #include "llpanelexperiencelog.h" #include "llpanelexperiencepicker.h" diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index eda9e51d23..b218f4f756 100755 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -41,7 +41,6 @@ #include "llui.h" #include "message.h" #include "roles_constants.h" -#include "llhttpclient.h" #include "lltransactiontypes.h" #include "llstatusbar.h" #include "lleconomy.h" diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index cff8446545..b0cd1dd23e 100755 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -30,7 +30,6 @@ #include "llagent.h" #include "llbufferstream.h" -#include "llhttpclient.h" #include "llinventoryfunctions.h" #include "llinventoryobserver.h" #include "llnotificationsutil.h" diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 55157cc040..ed20641312 100755 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -38,6 +38,7 @@ #include "httpoptions.h" #include "httpheaders.h" #include "httphandler.h" +#include "llthread.h" #define LLCONVEXDECOMPINTER_STATIC 1 diff --git a/indra/newview/llpanelexperiencepicker.cpp b/indra/newview/llpanelexperiencepicker.cpp index d71ced443b..dcc5f4f234 100644 --- a/indra/newview/llpanelexperiencepicker.cpp +++ b/indra/newview/llpanelexperiencepicker.cpp @@ -42,7 +42,6 @@ #include "llviewercontrol.h" #include "llfloater.h" #include "lltrans.h" -#include "llhttpclient.h" // *TODO: Rider, remove when converting #define BTN_FIND "find" #define BTN_OK "ok_btn" diff --git a/indra/newview/llpanelgroupexperiences.cpp b/indra/newview/llpanelgroupexperiences.cpp index 9b4c67a120..a88a55ab22 100644 --- a/indra/newview/llpanelgroupexperiences.cpp +++ b/indra/newview/llpanelgroupexperiences.cpp @@ -31,7 +31,6 @@ #include "lluictrlfactory.h" #include "roles_constants.h" -#include "llhttpclient.h" #include "llagent.h" #include "llviewerregion.h" #include "llflatlistview.h" diff --git a/indra/newview/llsecapi.cpp b/indra/newview/llsecapi.cpp index 43bb7b1596..4f9f83b6f2 100755 --- a/indra/newview/llsecapi.cpp +++ b/indra/newview/llsecapi.cpp @@ -32,7 +32,6 @@ #include <openssl/evp.h> #include <openssl/err.h> #include <map> -#include "llhttpclient.h" @@ -99,46 +98,6 @@ std::ostream& operator <<(std::ostream& s, const LLCredential& cred) return s << (std::string)cred; } - -// secapiSSLCertVerifyCallback -// basic callback called when a cert verification is requested. -// calls SECAPI to validate the context -// not initialized in the above initialization function, due to unit tests -// see llappviewer - -int secapiSSLCertVerifyCallback(X509_STORE_CTX *ctx, void *param) -{ - LLURLRequest *req = (LLURLRequest *)param; - LLPointer<LLCertificateStore> store = gSecAPIHandler->getCertificateStore(""); - LLPointer<LLCertificateChain> chain = gSecAPIHandler->getCertificateChain(ctx); - LLSD validation_params = LLSD::emptyMap(); - LLURI uri(req->getURL()); - validation_params[CERT_HOSTNAME] = uri.hostName(); - try - { - // we rely on libcurl to validate the hostname, as libcurl does more extensive validation - // leaving our hostname validation call mechanism for future additions with respect to - // OS native (Mac keyring, windows CAPI) validation. - store->validate(VALIDATION_POLICY_SSL & (~VALIDATION_POLICY_HOSTNAME), chain, validation_params); - } - catch (LLCertValidationTrustException& cert_exception) - { - LL_WARNS("AppInit") << "Cert not trusted: " << cert_exception.getMessage() << LL_ENDL; - return 0; - } - catch (LLCertException& cert_exception) - { - LL_WARNS("AppInit") << "cert error " << cert_exception.getMessage() << LL_ENDL; - return 0; - } - catch (...) - { - LL_WARNS("AppInit") << "cert error " << LL_ENDL; - return 0; - } - return 1; -} - LLSD LLCredential::getLoginParams() { LLSD result = LLSD::emptyMap(); diff --git a/indra/newview/llsecapi.h b/indra/newview/llsecapi.h index c01d318f56..6fe3ee31cf 100755 --- a/indra/newview/llsecapi.h +++ b/indra/newview/llsecapi.h @@ -489,7 +489,4 @@ void registerSecHandler(const std::string& handler_type, extern LLPointer<LLSecAPIHandler> gSecAPIHandler; -int secapiSSLCertVerifyCallback(X509_STORE_CTX *ctx, void *param); - - #endif // LL_SECAPI_H diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 0e23e2ad10..67ac875428 100755 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -37,7 +37,6 @@ #include "llfloatersidepanelcontainer.h" #include "llfoldertype.h" #include "llfolderview.h" -#include "llhttpclient.h" #include "llinventorybridge.h" #include "llinventoryfunctions.h" #include "llinventorymodel.h" diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 4246f72202..047e23cefc 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -112,7 +112,6 @@ #include "llgroupmgr.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" -#include "llhttpclient.h" #include "llimagebmp.h" #include "llinventorybridge.h" #include "llinventorymodel.h" diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index 1ca2011a70..5390573f7b 100755 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -574,25 +574,3 @@ LLTranslationAPIHandler& LLTranslate::getHandler(EService service) return bing; } - -// static -void LLTranslate::sendRequest(const std::string& url, LLHTTPClient::ResponderPtr responder) -{ - static const float REQUEST_TIMEOUT = 5; - static LLSD sHeader; - - if (!sHeader.size()) - { - std::string user_agent = llformat("%s %d.%d.%d (%d)", - LLVersionInfo::getChannel().c_str(), - LLVersionInfo::getMajor(), - LLVersionInfo::getMinor(), - LLVersionInfo::getPatch(), - LLVersionInfo::getBuild()); - - sHeader.insert(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_TEXT_PLAIN); - sHeader.insert(HTTP_OUT_HEADER_USER_AGENT, user_agent); - } - - LLHTTPClient::get(url, responder, sHeader, REQUEST_TIMEOUT); -} diff --git a/indra/newview/lltranslate.h b/indra/newview/lltranslate.h index 49a0105dbb..bf431cdfbb 100755 --- a/indra/newview/lltranslate.h +++ b/indra/newview/lltranslate.h @@ -27,7 +27,6 @@ #ifndef LL_LLTRANSLATE_H #define LL_LLTRANSLATE_H -#include "llhttpclient.h" #include "llbufferstream.h" #include <boost/function.hpp> @@ -95,7 +94,6 @@ public : private: static LLTranslationAPIHandler& getPreferredHandler(); static LLTranslationAPIHandler& getHandler(EService service); - static void sendRequest(const std::string& url, LLHTTPClient::ResponderPtr responder); }; #endif diff --git a/indra/newview/lluploadfloaterobservers.h b/indra/newview/lluploadfloaterobservers.h index 02baf8f1c0..15c3dad38e 100755 --- a/indra/newview/lluploadfloaterobservers.h +++ b/indra/newview/lluploadfloaterobservers.h @@ -28,7 +28,6 @@ #define LL_LLUPLOADFLOATEROBSERVERS_H #include "llfloater.h" -#include "llhttpclient.h" #include "llhandle.h" class LLUploadPermissionsObserver diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 782a27a846..4f24dfafac 100755 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -66,7 +66,6 @@ // linden libraries #include "lleconomy.h" -#include "llhttpclient.h" #include "llnotificationsutil.h" #include "llsdserialize.h" #include "llsdutil.h" diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 57548b6e8f..4ed90d26b7 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -34,7 +34,6 @@ #include "llavatarnamecache.h" // name lookup cap url #include "llfloaterreg.h" #include "llmath.h" -#include "llhttpclient.h" #include "llregionflags.h" #include "llregionhandle.h" #include "llsurface.h" diff --git a/indra/newview/tests/lltranslate_test.cpp b/indra/newview/tests/lltranslate_test.cpp deleted file mode 100755 index 5e73dbb981..0000000000 --- a/indra/newview/tests/lltranslate_test.cpp +++ /dev/null @@ -1,340 +0,0 @@ -/** - * @file lltranslate_test.cpp - * - * $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2011, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "linden_common.h" - -#include "../test/lltut.h" -#include "../lltranslate.h" -#include "../llversioninfo.h" -#include "../llviewercontrol.h" - -#include "llbufferstream.h" -#include "lltrans.h" -#include "llui.h" - -#include "../../llmessage/llhttpconstants.cpp" - -static const std::string GOOGLE_VALID_RESPONSE1 = -"{\ - \"data\": {\ - \"translations\": [\ - {\ - \"translatedText\": \"привет\",\ - \"detectedSourceLanguage\": \"es\"\ - }\ - ]\ - }\ -}"; - -static const std::string GOOGLE_VALID_RESPONSE2 = -"{\ - \"data\": {\ - \"translations\": [\ - {\ - \"translatedText\": \"привет\"\ - }\ - ]\ - }\ -}\ -"; - -static const std::string GOOGLE_VALID_RESPONSE3 = -"{\ - \"error\": {\ - \"errors\": [\ - {\ - \"domain\": \"global\",\ - \"reason\": \"invalid\",\ - \"message\": \"Invalid Value\"\ - }\ - ],\ - \"code\": 400,\ - \"message\": \"Invalid Value\"\ - }\ -}"; - -static const std::string BING_VALID_RESPONSE1 = -"<string xmlns=\"http://schemas.microsoft.com/2003/10/Serialization/\">Привет</string>"; - -static const std::string BING_VALID_RESPONSE2 = -"<html><body><h1>Argument Exception</h1><p>Method: Translate()</p><p>Parameter: </p>\ -<p>Message: 'from' must be a valid language</p><code></code>\ -<p>message id=3743.V2_Rest.Translate.58E8454F</p></body></html>"; - -static const std::string BING_VALID_RESPONSE3 = -"<html><body><h1>Argument Exception</h1><p>Method: Translate()</p>\ -<p>Parameter: appId</p><p>Message: Invalid appId
\nParameter name: appId</p>\ -<code></code><p>message id=3737.V2_Rest.Translate.56016759</p></body></html>"; - -namespace tut -{ - class translate_test - { - protected: - void test_translation( - LLTranslationAPIHandler& handler, - int status, const std::string& resp, - const std::string& exp_trans, const std::string& exp_lang, const std::string& exp_err) - { - std::string translation, detected_lang, err_msg; - bool rc = handler.parseResponse(status, resp, translation, detected_lang, err_msg); - ensure_equals("rc", rc, (status == 200)); - ensure_equals("err_msg", err_msg, exp_err); - ensure_equals("translation", translation, exp_trans); - ensure_equals("detected_lang", detected_lang, exp_lang); - } - - LLGoogleTranslationHandler mGoogle; - LLBingTranslationHandler mBing; - }; - - typedef test_group<translate_test> translate_test_group_t; - typedef translate_test_group_t::object translate_test_object_t; - tut::translate_test_group_t tut_translate("LLTranslate"); - - template<> template<> - void translate_test_object_t::test<1>() - { - test_translation(mGoogle, 200, GOOGLE_VALID_RESPONSE1, "привет", "es", ""); - } - - template<> template<> - void translate_test_object_t::test<2>() - { - test_translation(mGoogle, 200, GOOGLE_VALID_RESPONSE2, "привет", "", ""); - } - - template<> template<> - void translate_test_object_t::test<3>() - { - test_translation(mGoogle, 400, GOOGLE_VALID_RESPONSE3, "", "", "Invalid Value"); - } - - template<> template<> - void translate_test_object_t::test<4>() - { - test_translation(mGoogle, 400, - "", - "", "", "* Line 1, Column 1\n Syntax error: value, object or array expected.\n"); - } - - template<> template<> - void translate_test_object_t::test<5>() - { - test_translation(mGoogle, 400, - "[]", - "", "", ""); - } - - template<> template<> - void translate_test_object_t::test<6>() - { - test_translation(mGoogle, 400, - "{\"oops\": \"invalid\"}", - "", "", ""); - } - - template<> template<> - void translate_test_object_t::test<7>() - { - test_translation(mGoogle, 400, - "{\"data\": {}}", - "", "", ""); - } - - template<> template<> - void translate_test_object_t::test<8>() - { - test_translation(mGoogle, 400, - "{\"data\": { \"translations\": [ {} ] }}", - "", "", ""); - } - - template<> template<> - void translate_test_object_t::test<9>() - { - test_translation(mGoogle, 400, - "{\"data\": { \"translations\": [ { \"translatedTextZZZ\": \"привет\", \"detectedSourceLanguageZZZ\": \"es\" } ] }}", - "", "", ""); - } - - template<> template<> - void translate_test_object_t::test<10>() - { - test_translation(mBing, 200, BING_VALID_RESPONSE1, "Привет", "", ""); - } - - template<> template<> - void translate_test_object_t::test<11>() - { - test_translation(mBing, 400, BING_VALID_RESPONSE2, "", "", "'from' must be a valid language"); - } - - template<> template<> - void translate_test_object_t::test<12>() - { - test_translation(mBing, 400, BING_VALID_RESPONSE3, "", "", "Invalid appId\nParameter name: appId"); - } - - template<> template<> - void translate_test_object_t::test<13>() - { - test_translation(mBing, 200, - "Привет</string>", - "Привет", "", ""); - } - - template<> template<> - void translate_test_object_t::test<14>() - { - test_translation(mBing, 200, - "<string xmlns=\"http://schemas.microsoft.com/2003/10/Serialization/\">Привет", - "Привет", "", ""); - } - - template<> template<> - void translate_test_object_t::test<15>() - { - test_translation(mBing, 200, - "Привет", - "Привет", "", ""); - } - - template<> template<> - void translate_test_object_t::test<16>() - { - test_translation(mBing, 400, - "Message: some error</p>", - "", "", "some error"); - } - - template<> template<> - void translate_test_object_t::test<17>() - { - test_translation(mBing, 400, - "Message: some error", - "", "", "some error"); - } - - template<> template<> - void translate_test_object_t::test<18>() - { - test_translation(mBing, 400, - "some error</p>", - "", "", "some error"); - } - - template<> template<> - void translate_test_object_t::test<19>() - { - test_translation(mBing, 400, - "some error", - "", "", "some error"); - } - - template<> template<> - void translate_test_object_t::test<20>() - { - std::string url; - mBing.getTranslateURL(url, "en", "es", "hi"); - ensure_equals("bing URL", url, - "http://api.microsofttranslator.com/v2/Http.svc/Translate?appId=dummy&text=hi&to=es&from=en"); - } - - template<> template<> - void translate_test_object_t::test<21>() - { - std::string url; - mBing.getTranslateURL(url, "", "es", "hi"); - ensure_equals("bing URL", url, - "http://api.microsofttranslator.com/v2/Http.svc/Translate?appId=dummy&text=hi&to=es"); - } - - template<> template<> - void translate_test_object_t::test<22>() - { - std::string url; - mGoogle.getTranslateURL(url, "en", "es", "hi"); - ensure_equals("google URL", url, - "https://www.googleapis.com/language/translate/v2?key=dummy&q=hi&target=es&source=en"); - } - - template<> template<> - void translate_test_object_t::test<23>() - { - std::string url; - mGoogle.getTranslateURL(url, "", "es", "hi"); - ensure_equals("google URL", url, - "https://www.googleapis.com/language/translate/v2?key=dummy&q=hi&target=es"); - } -} - -//== Misc stubs =============================================================== -LLControlGroup gSavedSettings("test"); - -std::string LLUI::getLanguage() { return "en"; } -std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args) { return "dummy"; } - -LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker<LLControlGroup, std::string>(name) {} -std::string LLControlGroup::getString(const std::string& name) { return "dummy"; } -LLControlGroup::~LLControlGroup() {} - -LLCurl::Responder::Responder() {} -void LLCurl::Responder::httpFailure() { } -void LLCurl::Responder::httpSuccess() { } -void LLCurl::Responder::httpCompleted() { } -void LLCurl::Responder::completedRaw(LLChannelDescriptors const &,boost::shared_ptr<LLBufferArray> const &) { } -LLCurl::Responder::~Responder() {} - -void LLHTTPClient::get(const std::string&, const LLSD&, ResponderPtr, const LLSD&, const F32, bool) {} -void LLHTTPClient::get(const std::string&, LLPointer<LLCurl::Responder>, const LLSD&, const F32, bool) {} - -LLBufferStream::LLBufferStream(const LLChannelDescriptors& channels, LLBufferArray* buffer) -: std::iostream(&mStreamBuf), mStreamBuf(channels, buffer) {} -LLBufferStream::~LLBufferStream() {} - -LLBufferStreamBuf::LLBufferStreamBuf(const LLChannelDescriptors&, LLBufferArray*) {} -#if( LL_WINDOWS || __GNUC__ > 2) -LLBufferStreamBuf::pos_type LLBufferStreamBuf::seekoff( - off_type off, - std::ios::seekdir way, - std::ios::openmode which) -#else -streampos LLBufferStreamBuf::seekoff( - streamoff off, - std::ios::seekdir way, - std::ios::openmode which) -#endif -{ return 0; } -int LLBufferStreamBuf::sync() {return 0;} -int LLBufferStreamBuf::underflow() {return 0;} -int LLBufferStreamBuf::overflow(int) {return 0;} -LLBufferStreamBuf::~LLBufferStreamBuf() {} - -S32 LLVersionInfo::getBuild() { return 0; } -const std::string& LLVersionInfo::getChannel() {static std::string dummy; return dummy;} -S32 LLVersionInfo::getMajor() { return 0; } -S32 LLVersionInfo::getMinor() { return 0; } -S32 LLVersionInfo::getPatch() { return 0; } |