From 330840af7c363accc8e12d073ba91b871c578d27 Mon Sep 17 00:00:00 2001 From: Martin Reddy Date: Fri, 4 Sep 2009 12:11:27 +0000 Subject: Merging the SLURLs Everywhere branch (viewer-2.0.0-slurls-3) into Viewer 2.0 (viewer-2.0.0-3). This provides support for clickable Urls in text editors and textboxes, with right-click context menus, tooltips, and alternate link labels. This includes alert boxes, the login progress window, local chat and IM interfaces, etc. As well as context menus for avatars and groups in list widgets. Includes fixes for the following individual JIRAs: DEV-8763 VWR-10636: Hyperlinks in alert dialogs should be selectable (clickable)! DEV-38829 EXT-742: Remove LLLink class DEV-35459 VWR-14679: SLURLs and teleport Links not parsed properly DEV-19842 VWR-8773: Closing parenthesis ")" breaks urls DEV-21577 VWR-9405: In-world SLURLs containing "(" or ")" are not treated as a hyperlink in chat DEV-37652 SEC-435: Object Chat/IMs are untraceable (VWR-2388) Fix has left flaw DEV-10353: URLs in chat log terminated incorrectly when newline in chat DEV-2925: In chat history, use a teleport hyperlink as source name for object IMs DEV-36192: Need a way to copy Avatar names and Group names DEV-2926: Allow viewer hyperlinks to have different text than the actual url DEV-27253: Add easy way to copy URLs from viewer chat DEV-38274: Make About Second Life window use new Url hyperlinking features DEV-39076: No url support in Text Editors DEV-7476 VWR-2172: Add hyperlinks to chat console for easier access DEV-7475: Add hyperlinks to notecards! DEV-35375 EXT-128: HTTPS urls aren't loaded in the internal browser by click Master JIRA issues: DEV-32819, DEV-323820, DEV-7474 Testing performed against QAR-1789 svn merge -r 131623:131889 svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-slurl-3 svn merge -r 131978:132515 svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-slurl-3 --- indra/llui/tests/llurlmatch_test.cpp | 177 +++++++++++++++++++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 indra/llui/tests/llurlmatch_test.cpp (limited to 'indra/llui/tests/llurlmatch_test.cpp') diff --git a/indra/llui/tests/llurlmatch_test.cpp b/indra/llui/tests/llurlmatch_test.cpp new file mode 100644 index 0000000000..fcf8f4d62f --- /dev/null +++ b/indra/llui/tests/llurlmatch_test.cpp @@ -0,0 +1,177 @@ +/** + * @file llurlmatch_test.cpp + * @author Martin Reddy + * @brief Unit tests for LLUrlMatch + * + * $LicenseInfo:firstyear=2009&license=internal$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of + * this source code is governed by the Linden Lab Source Code Disclosure + * Agreement ("Agreement") previously entered between you and Linden + * Lab. By accessing, using, copying, modifying or distributing this + * software, you acknowledge that you have been informed of your + * obligations under the Agreement and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "../llurlmatch.h" +#include "lltut.h" + +namespace tut +{ + struct LLUrlMatchData + { + }; + + typedef test_group factory; + typedef factory::object object; +} + +namespace +{ + tut::factory tf("LLUrlMatch"); +} + +namespace tut +{ + template<> template<> + void object::test<1>() + { + // + // test the empty() method + // + LLUrlMatch match; + ensure("empty()", match.empty()); + + match.setValues(0, 1, "http://secondlife.com", "Second Life", "", "", "", ""); + ensure("! empty()", ! match.empty()); + } + + template<> template<> + void object::test<2>() + { + // + // test the getStart() method + // + LLUrlMatch match; + ensure_equals("getStart() == 0", match.getStart(), 0); + + match.setValues(10, 20, "", "", "", "", "", ""); + ensure_equals("getStart() == 10", match.getStart(), 10); + } + + template<> template<> + void object::test<3>() + { + // + // test the getEnd() method + // + LLUrlMatch match; + ensure_equals("getEnd() == 0", match.getEnd(), 0); + + match.setValues(10, 20, "", "", "", "", "", ""); + ensure_equals("getEnd() == 20", match.getEnd(), 20); + } + + template<> template<> + void object::test<4>() + { + // + // test the getUrl() method + // + LLUrlMatch match; + ensure_equals("getUrl() == ''", match.getUrl(), ""); + + match.setValues(10, 20, "http://slurl.com/", "", "", "", "", ""); + ensure_equals("getUrl() == 'http://slurl.com/'", match.getUrl(), "http://slurl.com/"); + + match.setValues(10, 20, "", "", "", "", "", ""); + ensure_equals("getUrl() == '' (2)", match.getUrl(), ""); + } + + template<> template<> + void object::test<5>() + { + // + // test the getLabel() method + // + LLUrlMatch match; + ensure_equals("getLabel() == ''", match.getLabel(), ""); + + match.setValues(10, 20, "", "Label", "", "", "", ""); + ensure_equals("getLabel() == 'Label'", match.getLabel(), "Label"); + + match.setValues(10, 20, "", "", "", "", "", ""); + ensure_equals("getLabel() == '' (2)", match.getLabel(), ""); + } + + template<> template<> + void object::test<6>() + { + // + // test the getTooltip() method + // + LLUrlMatch match; + ensure_equals("getTooltip() == ''", match.getTooltip(), ""); + + match.setValues(10, 20, "", "", "Info", "", "", ""); + ensure_equals("getTooltip() == 'Info'", match.getTooltip(), "Info"); + + match.setValues(10, 20, "", "", "", "", "", ""); + ensure_equals("getTooltip() == '' (2)", match.getTooltip(), ""); + } + + template<> template<> + void object::test<7>() + { + // + // test the getIcon() method + // + LLUrlMatch match; + ensure_equals("getIcon() == ''", match.getIcon(), ""); + + match.setValues(10, 20, "", "", "", "Icon", "", ""); + ensure_equals("getIcon() == 'Icon'", match.getIcon(), "Icon"); + + match.setValues(10, 20, "", "", "", "", "", ""); + ensure_equals("getIcon() == '' (2)", match.getIcon(), ""); + } + + template<> template<> + void object::test<8>() + { + // + // test the getMenuName() method + // + LLUrlMatch match; + ensure("getMenuName() empty", match.getMenuName().empty()); + + match.setValues(10, 20, "", "", "", "Icon", "xui_file.xml", ""); + ensure_equals("getMenuName() == \"xui_file.xml\"", match.getMenuName(), "xui_file.xml"); + + match.setValues(10, 20, "", "", "", "", "", ""); + ensure("getMenuName() empty (2)", match.getMenuName().empty()); + } + + template<> template<> + void object::test<9>() + { + // + // test the getLocation() method + // + LLUrlMatch match; + ensure("getLocation() empty", match.getLocation().empty()); + + match.setValues(10, 20, "", "", "", "Icon", "xui_file.xml", "Paris"); + ensure_equals("getLocation() == \"Paris\"", match.getLocation(), "Paris"); + + match.setValues(10, 20, "", "", "", "", "", ""); + ensure("getLocation() empty (2)", match.getLocation().empty()); + } +} -- cgit v1.2.3 From a9b2296b2b5664cfc8d86c7f99c00c10268e250a Mon Sep 17 00:00:00 2001 From: Christian Goetze Date: Mon, 7 Sep 2009 07:56:10 +0000 Subject: svn merge -r132705:132723 svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-3-stable propagate the changes to make stabel build back down. --- indra/llui/tests/llurlmatch_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/tests/llurlmatch_test.cpp') diff --git a/indra/llui/tests/llurlmatch_test.cpp b/indra/llui/tests/llurlmatch_test.cpp index fcf8f4d62f..4dae49db90 100644 --- a/indra/llui/tests/llurlmatch_test.cpp +++ b/indra/llui/tests/llurlmatch_test.cpp @@ -3,7 +3,7 @@ * @author Martin Reddy * @brief Unit tests for LLUrlMatch * - * $LicenseInfo:firstyear=2009&license=internal$ + * $LicenseInfo:firstyear=2009&license=viewergpl$ * * Copyright (c) 2009, Linden Research, Inc. * -- cgit v1.2.3