/usr/lib/Wt/test/trampoline/RefEncoder.C is in witty-examples 3.3.0-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | /*
* Copyright (C) 2013 Emweb bvba, Kessel-Lo, Belgium.
*
* See the LICENSE file for terms of use.
*/
#include <boost/test/unit_test.hpp>
#include <sstream>
#include <Wt/WAnchor>
#include <Wt/WImage>
#include <Wt/WText>
#include <Wt/Test/WTestEnvironment>
#include <Wt/WApplication>
using namespace Wt;
BOOST_AUTO_TEST_CASE(test_trampoline1)
{
Wt::Test::WTestEnvironment env;
env.setSessionIdInUrl(true);
Wt::WApplication app(env);
{
Wt::WText t("<div style=\"background-image: "
"url(http://www.google.be)\"></div>");
std::stringstream s;
t.htmlText(s);
std::size_t red = s.str().find
("?request=redirect&url=http%3a//www.google.be&hash=");
BOOST_REQUIRE(red != std::string::npos);
}
{
Wt::WText t("<div style=\"background-image: "
"url('http://www.google.be')\"></div>");
std::stringstream s;
t.htmlText(s);
std::size_t red = s.str().find
("?request=redirect&url=http%3a//www.google.be&hash=");
BOOST_REQUIRE(red != std::string::npos);
}
{
Wt::WText t("<div style=\"background-image: "
"url('http://www.google.be')\">"
"<span style=\"background-image: "
"url('http://www.webtoolkit.eu')\"></span></div>");
std::stringstream s;
t.htmlText(s);
std::size_t red = s.str().find
("?request=redirect&url=http%3a//www.google.be&hash=");
BOOST_REQUIRE(red != std::string::npos);
red = s.str().find
("?request=redirect&url=http%3a//www.webtoolkit.eu&hash=");
BOOST_REQUIRE(red != std::string::npos);
}
{
Wt::WImage img("http://www.google.be");
std::stringstream s;
img.htmlText(s);
std::size_t red = s.str().find
("?request=redirect&url=http%3a//www.google.be&hash=");
BOOST_REQUIRE(red != std::string::npos);
}
{
Wt::WAnchor img("http://www.google.be");
std::stringstream s;
img.htmlText(s);
std::size_t red = s.str().find
("?request=redirect&url=http%3a//www.google.be&hash=");
BOOST_REQUIRE(red != std::string::npos);
}
{
Wt::WContainerWidget w;
w.decorationStyle().setBackgroundImage("http://www.google.be");
std::stringstream s;
w.htmlText(s);
std::cerr << s.str() << std::endl;
std::size_t red = s.str().find
("?request=redirect&url=http%3a//www.google.be&hash=");
BOOST_REQUIRE(red != std::string::npos);
}
}
|