summaryrefslogtreecommitdiff
path: root/indra/newview/tests/lllogininstance_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/tests/lllogininstance_test.cpp')
-rw-r--r--indra/newview/tests/lllogininstance_test.cpp115
1 files changed, 23 insertions, 92 deletions
diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp
index 67da9f2cdf..ef93586c6e 100644
--- a/indra/newview/tests/lllogininstance_test.cpp
+++ b/indra/newview/tests/lllogininstance_test.cpp
@@ -10,10 +10,7 @@
// Precompiled header
#include "../llviewerprecompiledheaders.h"
// Own header
-#include "../llsecapi.h"
-#include "../llviewernetwork.h"
#include "../lllogininstance.h"
-
// STL headers
// std headers
// external library headers
@@ -36,12 +33,7 @@ const std::string APPVIEWER_SERIALNUMBER("appviewer_serialno");
//-----------------------------------------------------------------------------
static LLEventStream gTestPump("test_pump");
-#include "../llslurl.h"
-#include "../llstartup.h"
-LLSLURL LLStartUp::sStartSLURL;
-
#include "lllogin.h"
-
static std::string gLoginURI;
static LLSD gLoginCreds;
static bool gDisconnectCalled = false;
@@ -62,68 +54,17 @@ void LLLogin::disconnect()
gDisconnectCalled = true;
}
-LLSD LLCredential::getLoginParams()
-{
- LLSD result = LLSD::emptyMap();
-
- // legacy credential
- result["passwd"] = "$1$testpasssd";
- result["first"] = "myfirst";
- result["last"] ="mylast";
- return result;
-}
-
//-----------------------------------------------------------------------------
#include "../llviewernetwork.h"
-LLGridManager::~LLGridManager()
-{
-}
-
-void LLGridManager::addGrid(LLSD& grid_data)
-{
-}
-LLGridManager::LLGridManager()
-{
-}
+unsigned char gMACAddress[MAC_ADDRESS_BYTES] = {'1','2','3','4','5','6'};
-void LLGridManager::getLoginURIs(std::vector<std::string>& uris)
+LLViewerLogin::LLViewerLogin() : mGridChoice(GRID_INFO_NONE) {}
+LLViewerLogin::~LLViewerLogin() {}
+void LLViewerLogin::getLoginURIs(std::vector<std::string>& uris) const
{
uris.push_back(VIEWERLOGIN_URI);
}
-
-void LLGridManager::addSystemGrid(const std::string& label,
- const std::string& name,
- const std::string& login,
- const std::string& helper,
- const std::string& login_page,
- const std::string& login_id)
-{
-}
-std::map<std::string, std::string> LLGridManager::getKnownGrids(bool favorite_only)
-{
- std::map<std::string, std::string> result;
- return result;
-}
-
-void LLGridManager::setGridChoice(const std::string& grid_name)
-{
-}
-
-bool LLGridManager::isInProductionGrid()
-{
- return false;
-}
-
-void LLGridManager::saveFavorites()
-{}
-std::string LLGridManager::getSLURLBase(const std::string& grid_name)
-{
- return "myslurl";
-}
-std::string LLGridManager::getAppSLURLBase(const std::string& grid_name)
-{
- return "myappslurl";
-}
+std::string LLViewerLogin::getGridLabel() const { return VIEWERLOGIN_GRIDLABEL; }
//-----------------------------------------------------------------------------
#include "../llviewercontrol.h"
@@ -145,6 +86,10 @@ BOOL LLControlGroup::declareString(const std::string& name, const std::string &i
#include "lluicolortable.h"
void LLUIColorTable::saveUserSettings(void)const {}
+//-----------------------------------------------------------------------------
+#include "../llurlsimstring.h"
+LLURLSimString LLURLSimString::sInstance;
+bool LLURLSimString::parse() { return true; }
//-----------------------------------------------------------------------------
#include "llnotifications.h"
@@ -252,29 +197,15 @@ namespace tut
gSavedSettings.declareString("NextLoginLocation", "", "", FALSE);
gSavedSettings.declareBOOL("LoginLastLocation", FALSE, "", FALSE);
- LLSD authenticator = LLSD::emptyMap();
- LLSD identifier = LLSD::emptyMap();
- identifier["type"] = "agent";
- identifier["first_name"] = "testfirst";
- identifier["last_name"] = "testlast";
- authenticator["passwd"] = "testpass";
- agentCredential = new LLCredential();
- agentCredential->setCredentialData(identifier, authenticator);
-
- authenticator = LLSD::emptyMap();
- identifier = LLSD::emptyMap();
- identifier["type"] = "account";
- identifier["username"] = "testuser";
- authenticator["secret"] = "testsecret";
- accountCredential = new LLCredential();
- accountCredential->setCredentialData(identifier, authenticator);
+ credentials["first"] = "testfirst";
+ credentials["last"] = "testlast";
+ credentials["passwd"] = "testpass";
logininstance->setNotificationsInterface(&notifications);
}
LLLoginInstance* logininstance;
- LLPointer<LLCredential> agentCredential;
- LLPointer<LLCredential> accountCredential;
+ LLSD credentials;
MockNotifications notifications;
};
@@ -288,7 +219,7 @@ namespace tut
set_test_name("Test Simple Success And Disconnect");
// Test default connect.
- logininstance->connect(agentCredential);
+ logininstance->connect(credentials);
ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI);
@@ -329,7 +260,7 @@ namespace tut
const std::string test_uri = "testing-uri";
// Test default connect.
- logininstance->connect(test_uri, agentCredential);
+ logininstance->connect(test_uri, credentials);
// connect should call LLLogin::connect to init gLoginURI and gLoginCreds.
ensure_equals("Default connect uri", gLoginURI, "testing-uri");
@@ -351,7 +282,7 @@ namespace tut
ensure("No TOS, failed auth", logininstance->authFailure());
// Start again.
- logininstance->connect(test_uri, agentCredential);
+ logininstance->connect(test_uri, credentials);
gTestPump.post(response); // Fail for tos again.
gTOSReplyPump->post(true); // Accept tos, should reconnect w/ agree_to_tos.
ensure_equals("Accepted agree to tos", gLoginCreds["params"]["agree_to_tos"].asBoolean(), true);
@@ -363,11 +294,11 @@ namespace tut
gTestPump.post(response);
ensure("TOS auth failure", logininstance->authFailure());
- logininstance->connect(test_uri, agentCredential);
+ logininstance->connect(test_uri, credentials);
ensure_equals("Reset to default for agree to tos", gLoginCreds["params"]["agree_to_tos"].asBoolean(), false);
// Critical Message failure response.
- logininstance->connect(test_uri, agentCredential);
+ logininstance->connect(test_uri, credentials);
response["data"]["reason"] = "critical"; // Change response to "critical message"
gTestPump.post(response);
@@ -381,7 +312,7 @@ namespace tut
response["data"]["reason"] = "key"; // bad creds.
gTestPump.post(response);
ensure("TOS auth failure", logininstance->authFailure());
- logininstance->connect(test_uri, agentCredential);
+ logininstance->connect(test_uri, credentials);
ensure_equals("Default for agree to tos", gLoginCreds["params"]["read_critical"].asBoolean(), false);
}
@@ -392,7 +323,7 @@ namespace tut
// Part 1 - Mandatory Update, with User accepts response.
// Test connect with update needed.
- logininstance->connect(agentCredential);
+ logininstance->connect(credentials);
ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI);
@@ -418,7 +349,7 @@ namespace tut
set_test_name("Test Mandatory Update User Decline");
// Test connect with update needed.
- logininstance->connect(agentCredential);
+ logininstance->connect(credentials);
ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI);
@@ -444,7 +375,7 @@ namespace tut
// Part 3 - Mandatory Update, with bogus response.
// Test connect with update needed.
- logininstance->connect(agentCredential);
+ logininstance->connect(credentials);
ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI);
@@ -470,7 +401,7 @@ namespace tut
// Part 3 - Mandatory Update, with bogus response.
// Test connect with update needed.
- logininstance->connect(agentCredential);
+ logininstance->connect(credentials);
ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI);