This source file includes following definitions.
- SetUpTestCase
- TearDownTestCase
- document
- SetUp
- TearDown
- TEST_F
- TEST_F
- TEST_F
- TEST_F
#include "config.h"
#include "core/rendering/RenderTableRow.h"
#include "FrameTestHelpers.h"
#include "WebFrame.h"
#include "WebFrameImpl.h"
#include "WebView.h"
#include "core/dom/Document.h"
#include "core/frame/LocalFrame.h"
#include <gtest/gtest.h>
using namespace blink;
namespace WebCore {
namespace {
class RenderTableRowDeathTest : public testing::Test {
protected:
static void SetUpTestCase()
{
s_webViewHelper = new FrameTestHelpers::WebViewHelper();
s_webViewHelper->initializeAndLoad("about:blank");
s_webViewHelper->webView()->setFocus(true);
}
static void TearDownTestCase()
{
delete s_webViewHelper;
}
static Document* document()
{
return toWebFrameImpl(s_webViewHelper->webView()->mainFrame())->frame()->document();
}
virtual void SetUp()
{
m_row = RenderTableRow::createAnonymous(document());
}
virtual void TearDown()
{
m_row->destroy();
}
RenderTableRow* m_row;
private:
static FrameTestHelpers::WebViewHelper* s_webViewHelper;
};
FrameTestHelpers::WebViewHelper* RenderTableRowDeathTest::s_webViewHelper = 0;
TEST_F(RenderTableRowDeathTest, CanSetRow)
{
static const unsigned rowIndex = 10;
m_row->setRowIndex(rowIndex);
EXPECT_EQ(rowIndex, m_row->rowIndex());
}
TEST_F(RenderTableRowDeathTest, CanSetRowToMaxRowIndex)
{
m_row->setRowIndex(maxRowIndex);
EXPECT_EQ(maxRowIndex, m_row->rowIndex());
}
#if !OS(ANDROID)
TEST_F(RenderTableRowDeathTest, CrashIfRowOverflowOnSetting)
{
ASSERT_DEATH(m_row->setRowIndex(maxRowIndex + 1), "");
}
TEST_F(RenderTableRowDeathTest, CrashIfSettingUnsetRowIndex)
{
ASSERT_DEATH(m_row->setRowIndex(unsetRowIndex), "");
}
#endif
}
}