Skip to content
Snippets Groups Projects
Commit fe28f89e authored by Thickbrick Sleaford's avatar Thickbrick Sleaford
Browse files

merge VWR-24420 into v-d

parents db1a63e9 964e9814
No related branches found
No related tags found
No related merge requests found
......@@ -219,6 +219,8 @@ Catherine Pfeffer
Celierra Darling
VWR-1274
VWR-6975
Coaldust Numbers
VWR-1095
Cron Stardust
VWR-10579
Cypren Christenson
......
This diff is collapsed.
This diff is collapsed.
......@@ -126,6 +126,7 @@ void LLAssetUploadResponder::error(U32 statusNum, const std::string& reason)
break;
}
LLUploadDialog::modalUploadFinished();
LLFilePicker::instance().reset(); // unlock file picker when bulk upload fails
}
//virtual
......
This diff is collapsed.
/**
* @file llfloaterwebcontent.h
* @brief floater for displaying web content - e.g. profiles and search (eventually)
*
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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$
*/
#ifndef LL_LLFLOATERWEBCONTENT_H
#define LL_LLFLOATERWEBCONTENT_H
#include "llfloater.h"
#include "llmediactrl.h"
class LLMediaCtrl;
class LLComboBox;
class LLTextBox;
class LLProgressBar;
class LLIconCtrl;
class LLFloaterWebContent :
public LLFloater,
public LLViewerMediaObserver
{
public:
LOG_CLASS(LLFloaterWebContent);
LLFloaterWebContent(const LLSD& key);
/**
* @file llfloaterwebcontent.h
* @brief floater for displaying web content - e.g. profiles and search (eventually)
*
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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$
*/
#ifndef LL_LLFLOATERWEBCONTENT_H
#define LL_LLFLOATERWEBCONTENT_H
#include "llfloater.h"
#include "llmediactrl.h"
class LLMediaCtrl;
class LLComboBox;
class LLTextBox;
class LLProgressBar;
class LLIconCtrl;
class LLFloaterWebContent :
public LLFloater,
public LLViewerMediaObserver
{
public:
LOG_CLASS(LLFloaterWebContent);
LLFloaterWebContent(const LLSD& key);
void initializeURLHistory();
static void create(const std::string &url, const std::string& target, const std::string& uuid = LLStringUtil::null);
static void closeRequest(const std::string &uuid);
static void geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height);
void geometryChanged(S32 x, S32 y, S32 width, S32 height);
/* virtual */ BOOL postBuild();
/* virtual */ void onClose(bool app_quitting);
/* virtual */ void draw();
// inherited from LLViewerMediaObserver
/*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
void onClickBack();
void onClickForward();
void onClickReload();
void onClickStop();
void onEnterAddress();
void onPopExternal();
private:
void open_media(const std::string& media_url, const std::string& target);
void set_current_url(const std::string& url);
LLMediaCtrl* mWebBrowser;
LLComboBox* mAddressCombo;
LLIconCtrl *mSecureLockIcon;
LLTextBox* mStatusBarText;
LLProgressBar* mStatusBarProgress;
std::string mCurrentURL;
std::string mUUID;
};
#endif // LL_LLFLOATERWEBCONTENT_H
static void create(const std::string &url, const std::string& target, const std::string& uuid = LLStringUtil::null);
static void closeRequest(const std::string &uuid);
static void geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height);
void geometryChanged(S32 x, S32 y, S32 width, S32 height);
/* virtual */ BOOL postBuild();
/* virtual */ void onClose(bool app_quitting);
/* virtual */ void draw();
// inherited from LLViewerMediaObserver
/*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
void onClickBack();
void onClickForward();
void onClickReload();
void onClickStop();
void onEnterAddress();
void onPopExternal();
private:
void open_media(const std::string& media_url, const std::string& target);
void set_current_url(const std::string& url);
LLMediaCtrl* mWebBrowser;
LLComboBox* mAddressCombo;
LLIconCtrl *mSecureLockIcon;
LLTextBox* mStatusBarText;
LLProgressBar* mStatusBarProgress;
std::string mCurrentURL;
std::string mUUID;
};
#endif // LL_LLFLOATERWEBCONTENT_H
......@@ -280,19 +280,19 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string&
void LLIMModel::LLIMSession::onAdHocNameCache(const LLAvatarName& av_name)
{
if (av_name.mIsDummy)
{
S32 separator_index = mName.rfind(" ");
std::string name = mName.substr(0, separator_index);
++separator_index;
std::string conference_word = mName.substr(separator_index, mName.length());
// additional check that session name is what we expected
if ("Conference" == conference_word)
{
LLStringUtil::format_map_t args;
args["[AGENT_NAME]"] = name;
LLTrans::findString(mName, "conference-title-incoming", args);
}
{
S32 separator_index = mName.rfind(" ");
std::string name = mName.substr(0, separator_index);
++separator_index;
std::string conference_word = mName.substr(separator_index, mName.length());
// additional check that session name is what we expected
if ("Conference" == conference_word)
{
LLStringUtil::format_map_t args;
args["[AGENT_NAME]"] = name;
LLTrans::findString(mName, "conference-title-incoming", args);
}
}
else
{
......
......@@ -100,7 +100,7 @@ class LLIMModel : public LLSingleton<LLIMModel>
void onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name);
void onAdHocNameCache(const LLAvatarName& av_name);
void onAdHocNameCache(const LLAvatarName& av_name);
//*TODO make private
static std::string generateHash(const std::set<LLUUID>& sorted_uuids);
......
......@@ -89,15 +89,15 @@ const static boost::regex TIMESTAMP_AND_STUFF("^(\\[\\d{4}/\\d{1,2}/\\d{1,2}\\s+
*/
const static boost::regex NAME_AND_TEXT("([^:]+[:]{1})?(\\s*)(.*)");
/**
* These are recognizers for matching the names of ad-hoc conferences when generating the log file name
* On invited side, an ad-hoc is named like "<first name> <last name> Conference 2010/11/19 03:43 f0f4"
* On initiating side, an ad-hoc is named like Ad-hoc Conference hash<hash>"
* If the naming system for ad-hoc conferences are change in LLIMModel::LLIMSession::buildHistoryFileName()
* then these definition need to be adjusted as well.
*/
const static boost::regex INBOUND_CONFERENCE("^[a-zA-Z]{1,31} [a-zA-Z]{1,31} Conference [0-9]{4}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2} [0-9a-f]{4}");
const static boost::regex OUTBOUND_CONFERENCE("^Ad-hoc Conference hash[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}");
/**
* These are recognizers for matching the names of ad-hoc conferences when generating the log file name
* On invited side, an ad-hoc is named like "<first name> <last name> Conference 2010/11/19 03:43 f0f4"
* On initiating side, an ad-hoc is named like Ad-hoc Conference hash<hash>"
* If the naming system for ad-hoc conferences are change in LLIMModel::LLIMSession::buildHistoryFileName()
* then these definition need to be adjusted as well.
*/
const static boost::regex INBOUND_CONFERENCE("^[a-zA-Z]{1,31} [a-zA-Z]{1,31} Conference [0-9]{4}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2} [0-9a-f]{4}");
const static boost::regex OUTBOUND_CONFERENCE("^Ad-hoc Conference hash[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}");
//is used to parse complex object names like "Xstreet SL Terminal v2.2.5 st"
const static std::string NAME_TEXT_DIVIDER(": ");
......
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater
legacy_header_height="18"
can_resize="true"
height="440"
layout="topleft"
min_height="140"
min_width="467"
name="floater_web_content"
help_topic="floater_web_content"
save_rect="true"
auto_tile="true"
title=""
initial_mime_type="text/html"
width="820">
<layout_stack
bottom="440"
follows="left|right|top|bottom"
layout="topleft"
left="5"
name="stack1"
orientation="vertical"
top="20"
width="810">
<layout_panel
auto_resize="false"
default_tab_group="1"
height="22"
layout="topleft"
left="0"
min_height="20"
name="nav_controls"
top="400"
user_resize="false"
width="800">
<button
image_overlay="Arrow_Left_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
hover_glow_amount="0.15"
tool_tip="Navigate back"
follows="left|top"
height="22"
layout="topleft"
left="1"
name="back"
top="0"
width="22">
<button.commit_callback
function="WebContent.Back" />
</button>
<button
image_overlay="Arrow_Right_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
tool_tip="Navigate forward"
follows="left|top"
height="22"
layout="topleft"
left="27"
name="forward"
top_delta="0"
width="22">
<button.commit_callback
function="WebContent.Forward" />
</button>
<button
image_overlay="Stop_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
tool_tip="Stop navigation"
enabled="true"
follows="left|top"
height="22"
layout="topleft"
left="51"
name="stop"
top_delta="0"
width="22">
<button.commit_callback
function="WebContent.Stop" />
</button>
<button
image_overlay="Refresh_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
tool_tip="Reload page"
follows="left|top"
height="22"
layout="topleft"
left="51"
name="reload"
top_delta="0"
width="22">
<button.commit_callback
function="WebContent.Reload" />
</button>
<combo_box
allow_text_entry="true"
follows="left|top|right"
tab_group="1"
height="22"
layout="topleft"
left_pad="4"
max_chars="1024"
name="address"
combo_editor.select_on_focus="true"
tool_tip="Enter URL here"
top_delta="0"
width="702">
<combo_box.commit_callback
function="WebContent.EnterAddress" />
</combo_box>
<icon
name="media_secure_lock_flag"
height="16"
follows="top|right"
image_name="Lock2"
layout="topleft"
left_delta="656"
top_delta="2"
visible="false"
tool_tip="Secured Browsing"
width="16" />
<button
image_overlay="ExternalBrowser_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
tool_tip="Open current URL in your desktop browser"
follows="right|top"
enabled="true"
height="22"
layout="topleft"
name="popexternal"
right="800"
top_delta="-2"
width="22">
<button.commit_callback
function="WebContent.PopExternal" />
</button>
</layout_panel>
<layout_panel
height="40"
layout="topleft"
left_delta="0"
name="external_controls"
top_delta="0"
user_resize="false"
width="540">
<web_browser
bottom="-22"
follows="all"
layout="topleft"
left="0"
name="webbrowser"
top="0"/>
<text
type="string"
length="100"
follows="bottom|left"
height="20"
layout="topleft"
left_delta="0"
name="statusbartext"
parse_urls="false"
text_color="0.4 0.4 0.4 1"
top_pad="5"
width="452"/>
<progress_bar
color_bar="0.3 1.0 0.3 1"
follows="bottom|right"
height="16"
top_delta="-1"
left_pad="24"
layout="topleft"
name="statusbarprogress"
width="64"/>
</layout_panel>
</layout_stack>
</floater>
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater
legacy_header_height="18"
can_resize="true"
height="440"
layout="topleft"
min_height="140"
min_width="467"
name="floater_web_content"
help_topic="floater_web_content"
save_rect="true"
auto_tile="true"
title=""
initial_mime_type="text/html"
width="820">
<layout_stack
bottom="440"
follows="left|right|top|bottom"
layout="topleft"
left="5"
name="stack1"
orientation="vertical"
top="20"
width="810">
<layout_panel
auto_resize="false"
default_tab_group="1"
height="22"
layout="topleft"
left="0"
min_height="20"
name="nav_controls"
top="400"
user_resize="false"
width="800">
<button
image_overlay="Arrow_Left_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
hover_glow_amount="0.15"
tool_tip="Navigate back"
follows="left|top"
height="22"
layout="topleft"
left="1"
name="back"
top="0"
width="22">
<button.commit_callback
function="WebContent.Back" />
</button>
<button
image_overlay="Arrow_Right_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
tool_tip="Navigate forward"
follows="left|top"
height="22"
layout="topleft"
left="27"
name="forward"
top_delta="0"
width="22">
<button.commit_callback
function="WebContent.Forward" />
</button>
<button
image_overlay="Stop_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
tool_tip="Stop navigation"
enabled="true"
follows="left|top"
height="22"
layout="topleft"
left="51"
name="stop"
top_delta="0"
width="22">
<button.commit_callback
function="WebContent.Stop" />
</button>
<button
image_overlay="Refresh_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
tool_tip="Reload page"
follows="left|top"
height="22"
layout="topleft"
left="51"
name="reload"
top_delta="0"
width="22">
<button.commit_callback
function="WebContent.Reload" />
</button>
<combo_box
allow_text_entry="true"
follows="left|top|right"
tab_group="1"
height="22"
layout="topleft"
left_pad="4"
max_chars="1024"
name="address"
combo_editor.select_on_focus="true"
tool_tip="Enter URL here"
top_delta="0"
width="702">
<combo_box.commit_callback
function="WebContent.EnterAddress" />
</combo_box>
<icon
name="media_secure_lock_flag"
height="16"
follows="top|right"
image_name="Lock2"
layout="topleft"
left_delta="656"
top_delta="2"
visible="false"
tool_tip="Secured Browsing"
width="16" />
<button
image_overlay="ExternalBrowser_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
tool_tip="Open current URL in your desktop browser"
follows="right|top"
enabled="true"
height="22"
layout="topleft"
name="popexternal"
right="800"
top_delta="-2"
width="22">
<button.commit_callback
function="WebContent.PopExternal" />
</button>
</layout_panel>
<layout_panel
height="40"
layout="topleft"
left_delta="0"
name="external_controls"
top_delta="0"
user_resize="false"
width="540">
<web_browser
bottom="-22"
follows="all"
layout="topleft"
left="0"
name="webbrowser"
top="0"/>
<text
type="string"
length="100"
follows="bottom|left"
height="20"
layout="topleft"
left_delta="0"
name="statusbartext"
parse_urls="false"
text_color="0.4 0.4 0.4 1"
top_pad="5"
width="452"/>
<progress_bar
color_bar="0.3 1.0 0.3 1"
follows="bottom|right"
height="16"
top_delta="-1"
left_pad="24"
layout="topleft"
name="statusbarprogress"
width="64"/>
</layout_panel>
</layout_stack>
</floater>
/**
* @file llremoteparcelrequest_test.cpp
* @author Brad Kittenbrink <brad@lindenlab.com>
*
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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 "../llremoteparcelrequest.h"
#include "../llagent.h"
#include "message.h"
namespace {
LLControlGroup s_saved_settings("dummy_settings");
const LLUUID TEST_PARCEL_ID("11111111-1111-1111-1111-111111111111");
}
LLCurl::Responder::Responder() { }
LLCurl::Responder::~Responder() { }
void LLCurl::Responder::error(U32,std::string const &) { }
void LLCurl::Responder::result(LLSD const &) { }
void LLCurl::Responder::errorWithContent(U32 status,std::string const &,LLSD const &) { }
void LLCurl::Responder::completedRaw(U32 status, std::string const &, LLChannelDescriptors const &,boost::shared_ptr<LLBufferArray> const &) { }
void LLCurl::Responder::completed(U32 status, std::string const &, LLSD const &) { }
void LLCurl::Responder::completedHeader(U32 status, std::string const &, LLSD const &) { }
void LLMessageSystem::getF32(char const *,char const *,F32 &,S32) { }
void LLMessageSystem::getU8(char const *,char const *,U8 &,S32) { }
void LLMessageSystem::getS32(char const *,char const *,S32 &,S32) { }
void LLMessageSystem::getString(char const *,char const *, std::string &,S32) { }
void LLMessageSystem::getUUID(char const *,char const *, LLUUID & out_id,S32)
{
out_id = TEST_PARCEL_ID;
}
void LLMessageSystem::nextBlock(char const *) { }
void LLMessageSystem::addUUID(char const *,LLUUID const &) { }
void LLMessageSystem::addUUIDFast(char const *,LLUUID const &) { }
void LLMessageSystem::nextBlockFast(char const *) { }
void LLMessageSystem::newMessage(char const *) { }
LLMessageSystem * gMessageSystem;
char * _PREHASH_AgentID;
char * _PREHASH_AgentData;
LLAgent gAgent;
LLAgent::LLAgent() : mAgentAccess(s_saved_settings) { }
LLAgent::~LLAgent() { }
void LLAgent::sendReliableMessage(void) { }
LLUUID gAgentSessionID;
LLUUID gAgentID;
LLUIColor::LLUIColor(void) { }
LLAgentAccess::LLAgentAccess(LLControlGroup & settings) : mSavedSettings(settings) { }
LLControlGroup::LLControlGroup(std::string const & name) : LLInstanceTracker<LLControlGroup, std::string>(name) { }
LLControlGroup::~LLControlGroup(void) { }
namespace tut
{
struct TestObserver : public LLRemoteParcelInfoObserver {
TestObserver() : mProcessed(false) { }
virtual void processParcelInfo(const LLParcelData& parcel_data)
{
mProcessed = true;
}
virtual void setParcelID(const LLUUID& parcel_id) { }
virtual void setErrorStatus(U32 status, const std::string& reason) { }
bool mProcessed;
};
struct RemoteParcelRequestData
{
RemoteParcelRequestData()
{
}
};
typedef test_group<RemoteParcelRequestData> remoteparcelrequest_t;
typedef remoteparcelrequest_t::object remoteparcelrequest_object_t;
tut::remoteparcelrequest_t tut_remoteparcelrequest("LLRemoteParcelRequest");
template<> template<>
void remoteparcelrequest_object_t::test<1>()
{
set_test_name("observer pointer");
boost::scoped_ptr<TestObserver> observer(new TestObserver());
LLRemoteParcelInfoProcessor & processor = LLRemoteParcelInfoProcessor::instance();
processor.addObserver(LLUUID(TEST_PARCEL_ID), observer.get());
processor.processParcelInfoReply(gMessageSystem, NULL);
ensure(observer->mProcessed);
}
template<> template<>
void remoteparcelrequest_object_t::test<2>()
{
set_test_name("CHOP-220: dangling observer pointer");
LLRemoteParcelInfoObserver * observer = new TestObserver();
LLRemoteParcelInfoProcessor & processor = LLRemoteParcelInfoProcessor::instance();
processor.addObserver(LLUUID(TEST_PARCEL_ID), observer);
delete observer;
observer = NULL;
processor.processParcelInfoReply(gMessageSystem, NULL);
}
}
/**
* @file llremoteparcelrequest_test.cpp
* @author Brad Kittenbrink <brad@lindenlab.com>
*
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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 "../llremoteparcelrequest.h"
#include "../llagent.h"
#include "message.h"
namespace {
LLControlGroup s_saved_settings("dummy_settings");
const LLUUID TEST_PARCEL_ID("11111111-1111-1111-1111-111111111111");
}
LLCurl::Responder::Responder() { }
LLCurl::Responder::~Responder() { }
void LLCurl::Responder::error(U32,std::string const &) { }
void LLCurl::Responder::result(LLSD const &) { }
void LLCurl::Responder::errorWithContent(U32 status,std::string const &,LLSD const &) { }
void LLCurl::Responder::completedRaw(U32 status, std::string const &, LLChannelDescriptors const &,boost::shared_ptr<LLBufferArray> const &) { }
void LLCurl::Responder::completed(U32 status, std::string const &, LLSD const &) { }
void LLCurl::Responder::completedHeader(U32 status, std::string const &, LLSD const &) { }
void LLMessageSystem::getF32(char const *,char const *,F32 &,S32) { }
void LLMessageSystem::getU8(char const *,char const *,U8 &,S32) { }
void LLMessageSystem::getS32(char const *,char const *,S32 &,S32) { }
void LLMessageSystem::getString(char const *,char const *, std::string &,S32) { }
void LLMessageSystem::getUUID(char const *,char const *, LLUUID & out_id,S32)
{
out_id = TEST_PARCEL_ID;
}
void LLMessageSystem::nextBlock(char const *) { }
void LLMessageSystem::addUUID(char const *,LLUUID const &) { }
void LLMessageSystem::addUUIDFast(char const *,LLUUID const &) { }
void LLMessageSystem::nextBlockFast(char const *) { }
void LLMessageSystem::newMessage(char const *) { }
LLMessageSystem * gMessageSystem;
char * _PREHASH_AgentID;
char * _PREHASH_AgentData;
LLAgent gAgent;
LLAgent::LLAgent() : mAgentAccess(s_saved_settings) { }
LLAgent::~LLAgent() { }
void LLAgent::sendReliableMessage(void) { }
LLUUID gAgentSessionID;
LLUUID gAgentID;
LLUIColor::LLUIColor(void) { }
LLAgentAccess::LLAgentAccess(LLControlGroup & settings) : mSavedSettings(settings) { }
LLControlGroup::LLControlGroup(std::string const & name) : LLInstanceTracker<LLControlGroup, std::string>(name) { }
LLControlGroup::~LLControlGroup(void) { }
namespace tut
{
struct TestObserver : public LLRemoteParcelInfoObserver {
TestObserver() : mProcessed(false) { }
virtual void processParcelInfo(const LLParcelData& parcel_data)
{
mProcessed = true;
}
virtual void setParcelID(const LLUUID& parcel_id) { }
virtual void setErrorStatus(U32 status, const std::string& reason) { }
bool mProcessed;
};
struct RemoteParcelRequestData
{
RemoteParcelRequestData()
{
}
};
typedef test_group<RemoteParcelRequestData> remoteparcelrequest_t;
typedef remoteparcelrequest_t::object remoteparcelrequest_object_t;
tut::remoteparcelrequest_t tut_remoteparcelrequest("LLRemoteParcelRequest");
template<> template<>
void remoteparcelrequest_object_t::test<1>()
{
set_test_name("observer pointer");
boost::scoped_ptr<TestObserver> observer(new TestObserver());
LLRemoteParcelInfoProcessor & processor = LLRemoteParcelInfoProcessor::instance();
processor.addObserver(LLUUID(TEST_PARCEL_ID), observer.get());
processor.processParcelInfoReply(gMessageSystem, NULL);
ensure(observer->mProcessed);
}
template<> template<>
void remoteparcelrequest_object_t::test<2>()
{
set_test_name("CHOP-220: dangling observer pointer");
LLRemoteParcelInfoObserver * observer = new TestObserver();
LLRemoteParcelInfoProcessor & processor = LLRemoteParcelInfoProcessor::instance();
processor.addObserver(LLUUID(TEST_PARCEL_ID), observer);
delete observer;
observer = NULL;
processor.processParcelInfoReply(gMessageSystem, NULL);
}
}
/**
* @file llupdaterservice_test.cpp
* @brief Tests of llupdaterservice.cpp.
*
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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$
*/
// Precompiled header
#include "linden_common.h"
// associated header
#include "../llupdaterservice.h"
#include "../llupdatechecker.h"
#include "../llupdatedownloader.h"
#include "../llupdateinstaller.h"
#include "../../../test/lltut.h"
//#define DEBUG_ON
#include "../../../test/debug.h"
#include "llevents.h"
#include "lldir.h"
/*****************************************************************************
* MOCK'd
*****************************************************************************/
LLUpdateChecker::LLUpdateChecker(LLUpdateChecker::Client & client)
{}
void LLUpdateChecker::check(std::string const & protocolVersion, std::string const & hostUrl,
std::string const & servicePath, std::string channel, std::string version)
{}
LLUpdateDownloader::LLUpdateDownloader(Client & ) {}
void LLUpdateDownloader::download(LLURI const & , std::string const &, std::string const &, bool){}
class LLDir_Mock : public LLDir
{
void initAppDirs(const std::string &app_name,
const std::string& app_read_only_data_dir = "") {}
U32 countFilesInDir(const std::string &dirname, const std::string &mask)
{
return 0;
}
BOOL getNextFileInDir(const std::string &dirname,
const std::string &mask,
std::string &fname)
{
return false;
}
void getRandomFileInDir(const std::string &dirname,
const std::string &mask,
std::string &fname) {}
std::string getCurPath() { return ""; }
BOOL fileExists(const std::string &filename) const { return false; }
std::string getLLPluginLauncher() { return ""; }
std::string getLLPluginFilename(std::string base_name) { return ""; }
} gDirUtil;
LLDir* gDirUtilp = &gDirUtil;
LLDir::LLDir() {}
LLDir::~LLDir() {}
S32 LLDir::deleteFilesInDir(const std::string &dirname,
const std::string &mask)
{ return 0; }
void LLDir::setChatLogsDir(const std::string &path){}
void LLDir::setPerAccountChatLogsDir(const std::string &username){}
void LLDir::setLindenUserDir(const std::string &username){}
void LLDir::setSkinFolder(const std::string &skin_folder){}
bool LLDir::setCacheDir(const std::string &path){ return true; }
void LLDir::dumpCurrentDirectories() {}
std::string LLDir::getExpandedFilename(ELLPath location,
const std::string &filename) const
{
return "";
}
std::string LLUpdateDownloader::downloadMarkerPath(void)
{
return "";
}
void LLUpdateDownloader::resume(void) {}
void LLUpdateDownloader::cancel(void) {}
void LLUpdateDownloader::setBandwidthLimit(U64 bytesPerSecond) {}
int ll_install_update(std::string const &, std::string const &, bool, LLInstallScriptMode)
{
return 0;
}
std::string const & ll_install_failed_marker_path()
{
static std::string wubba;
return wubba;
}
/*
#pragma warning(disable: 4273)
llus_mock_llifstream::llus_mock_llifstream(const std::string& _Filename,
ios_base::openmode _Mode,
int _Prot) :
std::basic_istream<char,std::char_traits< char > >(NULL,true)
{}
llus_mock_llifstream::~llus_mock_llifstream() {}
bool llus_mock_llifstream::is_open() const {return true;}
void llus_mock_llifstream::close() {}
*/
/*****************************************************************************
* TUT
*****************************************************************************/
namespace tut
{
struct llupdaterservice_data
{
llupdaterservice_data() :
pumps(LLEventPumps::instance()),
test_url("dummy_url"),
test_channel("dummy_channel"),
test_version("dummy_version")
{}
LLEventPumps& pumps;
std::string test_url;
std::string test_channel;
std::string test_version;
};
typedef test_group<llupdaterservice_data> llupdaterservice_group;
typedef llupdaterservice_group::object llupdaterservice_object;
llupdaterservice_group llupdaterservicegrp("LLUpdaterService");
template<> template<>
void llupdaterservice_object::test<1>()
{
DEBUG;
LLUpdaterService updater;
bool got_usage_error = false;
try
{
updater.startChecking();
}
catch(LLUpdaterService::UsageError)
{
got_usage_error = true;
}
ensure("Caught start before params", got_usage_error);
}
template<> template<>
void llupdaterservice_object::test<2>()
{
DEBUG;
LLUpdaterService updater;
bool got_usage_error = false;
try
{
updater.initialize("1.0",test_url, "update" ,test_channel, test_version);
updater.startChecking();
updater.initialize("1.0", "other_url", "update", test_channel, test_version);
}
catch(LLUpdaterService::UsageError)
{
got_usage_error = true;
}
ensure("Caught params while running", got_usage_error);
}
template<> template<>
void llupdaterservice_object::test<3>()
{
DEBUG;
LLUpdaterService updater;
updater.initialize("1.0", test_url, "update", test_channel, test_version);
updater.startChecking();
ensure(updater.isChecking());
updater.stopChecking();
ensure(!updater.isChecking());
}
}
/**
* @file llupdaterservice_test.cpp
* @brief Tests of llupdaterservice.cpp.
*
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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$
*/
// Precompiled header
#include "linden_common.h"
// associated header
#include "../llupdaterservice.h"
#include "../llupdatechecker.h"
#include "../llupdatedownloader.h"
#include "../llupdateinstaller.h"
#include "../../../test/lltut.h"
//#define DEBUG_ON
#include "../../../test/debug.h"
#include "llevents.h"
#include "lldir.h"
/*****************************************************************************
* MOCK'd
*****************************************************************************/
LLUpdateChecker::LLUpdateChecker(LLUpdateChecker::Client & client)
{}
void LLUpdateChecker::check(std::string const & protocolVersion, std::string const & hostUrl,
std::string const & servicePath, std::string channel, std::string version)
{}
LLUpdateDownloader::LLUpdateDownloader(Client & ) {}
void LLUpdateDownloader::download(LLURI const & , std::string const &, std::string const &, bool){}
class LLDir_Mock : public LLDir
{
void initAppDirs(const std::string &app_name,
const std::string& app_read_only_data_dir = "") {}
U32 countFilesInDir(const std::string &dirname, const std::string &mask)
{
return 0;
}
BOOL getNextFileInDir(const std::string &dirname,
const std::string &mask,
std::string &fname)
{
return false;
}
void getRandomFileInDir(const std::string &dirname,
const std::string &mask,
std::string &fname) {}
std::string getCurPath() { return ""; }
BOOL fileExists(const std::string &filename) const { return false; }
std::string getLLPluginLauncher() { return ""; }
std::string getLLPluginFilename(std::string base_name) { return ""; }
} gDirUtil;
LLDir* gDirUtilp = &gDirUtil;
LLDir::LLDir() {}
LLDir::~LLDir() {}
S32 LLDir::deleteFilesInDir(const std::string &dirname,
const std::string &mask)
{ return 0; }
void LLDir::setChatLogsDir(const std::string &path){}
void LLDir::setPerAccountChatLogsDir(const std::string &username){}
void LLDir::setLindenUserDir(const std::string &username){}
void LLDir::setSkinFolder(const std::string &skin_folder){}
bool LLDir::setCacheDir(const std::string &path){ return true; }
void LLDir::dumpCurrentDirectories() {}
std::string LLDir::getExpandedFilename(ELLPath location,
const std::string &filename) const
{
return "";
}
std::string LLUpdateDownloader::downloadMarkerPath(void)
{
return "";
}
void LLUpdateDownloader::resume(void) {}
void LLUpdateDownloader::cancel(void) {}
void LLUpdateDownloader::setBandwidthLimit(U64 bytesPerSecond) {}
int ll_install_update(std::string const &, std::string const &, bool, LLInstallScriptMode)
{
return 0;
}
std::string const & ll_install_failed_marker_path()
{
static std::string wubba;
return wubba;
}
/*
#pragma warning(disable: 4273)
llus_mock_llifstream::llus_mock_llifstream(const std::string& _Filename,
ios_base::openmode _Mode,
int _Prot) :
std::basic_istream<char,std::char_traits< char > >(NULL,true)
{}
llus_mock_llifstream::~llus_mock_llifstream() {}
bool llus_mock_llifstream::is_open() const {return true;}
void llus_mock_llifstream::close() {}
*/
/*****************************************************************************
* TUT
*****************************************************************************/
namespace tut
{
struct llupdaterservice_data
{
llupdaterservice_data() :
pumps(LLEventPumps::instance()),
test_url("dummy_url"),
test_channel("dummy_channel"),
test_version("dummy_version")
{}
LLEventPumps& pumps;
std::string test_url;
std::string test_channel;
std::string test_version;
};
typedef test_group<llupdaterservice_data> llupdaterservice_group;
typedef llupdaterservice_group::object llupdaterservice_object;
llupdaterservice_group llupdaterservicegrp("LLUpdaterService");
template<> template<>
void llupdaterservice_object::test<1>()
{
DEBUG;
LLUpdaterService updater;
bool got_usage_error = false;
try
{
updater.startChecking();
}
catch(LLUpdaterService::UsageError)
{
got_usage_error = true;
}
ensure("Caught start before params", got_usage_error);
}
template<> template<>
void llupdaterservice_object::test<2>()
{
DEBUG;
LLUpdaterService updater;
bool got_usage_error = false;
try
{
updater.initialize("1.0",test_url, "update" ,test_channel, test_version);
updater.startChecking();
updater.initialize("1.0", "other_url", "update", test_channel, test_version);
}
catch(LLUpdaterService::UsageError)
{
got_usage_error = true;
}
ensure("Caught params while running", got_usage_error);
}
template<> template<>
void llupdaterservice_object::test<3>()
{
DEBUG;
LLUpdaterService updater;
updater.initialize("1.0", test_url, "update", test_channel, test_version);
updater.startChecking();
ensure(updater.isChecking());
updater.stopChecking();
ensure(!updater.isChecking());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment