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
|
/*
Copyright (C) 2012 Samsung Electronics
Copyright (C) 2012 Intel Corporation. All rights reserved.
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; either
version 2.1 of the License, or (at your option) any later version.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include "EWK2UnitTestEnvironment.h"
#include <wtf/text/StringBuilder.h>
#include <wtf/text/StringConcatenate.h>
#include <wtf/text/WTFString.h>
namespace EWK2UnitTest {
EWK2UnitTestEnvironment::EWK2UnitTestEnvironment()
: m_defaultWidth(800)
, m_defaultHeight(600)
{
}
const char* EWK2UnitTestEnvironment::defaultTestPageUrl() const
{
return "file://"TEST_RESOURCES_DIR"/default_test_page.html";
}
const char* EWK2UnitTestEnvironment::defaultTheme() const
{
return TEST_THEME_DIR"/default.edj";
}
const char* EWK2UnitTestEnvironment::injectedBundleSample() const
{
return TEST_LIB_DIR "/libewk2UnitTestInjectedBundleSample.so";
}
CString EWK2UnitTestEnvironment::urlForResource(const char* resource)
{
return makeString("file://"TEST_RESOURCES_DIR"/", resource).utf8();
}
CString EWK2UnitTestEnvironment::pathForResource(const char* resource)
{
StringBuilder builder;
builder.appendLiteral(TEST_RESOURCES_DIR "/");
builder.append(resource);
return builder.toString().utf8();
}
CString EWK2UnitTestEnvironment::pathForTheme(const char* theme)
{
StringBuilder builder;
builder.appendLiteral(TEST_THEME_DIR "/");
builder.append(theme);
return builder.toString().utf8();
}
} // namespace EWK2UnitTest
|