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.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp
index 5af8acebaf..d3080d6e4a 100644
--- a/indra/newview/tests/lllogininstance_test.cpp
+++ b/indra/newview/tests/lllogininstance_test.cpp
@@ -91,15 +91,23 @@ LLURLSimString LLURLSimString::sInstance;
bool LLURLSimString::parse() { return true; }
//-----------------------------------------------------------------------------
+#include "llfloaterreg.h"
#include "../llfloatertos.h"
-static LLFloaterTOS::ETOSType gTOSType;
+static std::string gTOSType;
static LLFloaterTOS::YesNoCallback gTOSCallback;
-LLFloaterTOS* LLFloaterTOS::show(LLFloaterTOS::ETOSType type,
- const std::string & message,
- const YesNoCallback& callback)
+
+void LLFloaterTOS::setTOSCallback(YesNoCallback const & callback)
{
- gTOSType = type;
gTOSCallback = callback;
+}
+
+//static
+LLFloater* LLFloaterReg::showInstance(const std::string & name,
+ const LLSD & key,
+ BOOL focus)
+{
+ gTOSType = name;
+ gTOSCallback = LLFloaterTOS::YesNoCallback();
return NULL;
}
@@ -182,7 +190,7 @@ namespace tut
gLoginCreds.clear();
gDisconnectCalled = false;
- // gTOSType = -1; // Set to invalid value.
+ gTOSType = ""; // Set to invalid value.
gTOSCallback = 0; // clear the callback.
@@ -271,7 +279,7 @@ namespace tut
response["data"]["reason"] = "tos";
gTestPump.post(response);
- ensure_equals("TOS Dialog type", gTOSType, LLFloaterTOS::TOS_TOS);
+ ensure_equals("TOS Dialog type", gTOSType, "message_tos");
ensure("TOS callback given", gTOSCallback != 0);
gTOSCallback(false); // Call callback denying TOS.
ensure("No TOS, failed auth", logininstance->authFailure());
@@ -297,7 +305,7 @@ namespace tut
response["data"]["reason"] = "critical"; // Change response to "critical message"
gTestPump.post(response);
- ensure_equals("TOS Dialog type", gTOSType, LLFloaterTOS::TOS_CRITICAL_MESSAGE);
+ ensure_equals("TOS Dialog type", gTOSType, "message_critical");
ensure("TOS callback given", gTOSCallback != 0);
gTOSCallback(true);
ensure_equals("Accepted read critical message", gLoginCreds["params"]["read_critical"].asBoolean(), true);