Move the table death tests to core/rendering/

Those tests were added to web/tests as this was the only way
to test them at the time. They can now use DummyPageHolder and
be moved to core/rendering where they belong.

Review URL: https://codereview.chromium.org/361633003

git-svn-id: svn://svn.chromium.org/blink/trunk@177177 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent dc43c605
......@@ -3402,6 +3402,8 @@
'loader/MixedContentCheckerTest.cpp',
'page/NetworkStateNotifierTest.cpp',
'rendering/RenderOverflowTest.cpp',
'rendering/RenderTableCellTest.cpp',
'rendering/RenderTableRowTest.cpp',
'rendering/shapes/BoxShapeTest.cpp',
'testing/UnitTestHelpers.cpp',
'testing/UnitTestHelpers.h',
......
......@@ -27,11 +27,7 @@
#include "core/rendering/RenderTableCell.h"
#include "core/frame/LocalFrame.h"
#include "public/web/WebFrame.h"
#include "public/web/WebView.h"
#include "web/WebLocalFrameImpl.h"
#include "web/tests/FrameTestHelpers.h"
#include "core/testing/DummyPageHolder.h"
#include <gtest/gtest.h>
......@@ -43,28 +39,10 @@ namespace {
class RenderTableCellDeathTest : public testing::Test {
protected:
static void SetUpTestCase()
{
// It's unfortunate that we have to get the whole browser stack to test one RenderObject
// but the code needs it.
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 toWebLocalFrameImpl(s_webViewHelper->webView()->mainFrame())->frame()->document();
}
virtual void SetUp()
{
m_cell = RenderTableCell::createAnonymous(document());
m_pageHolder = DummyPageHolder::create(IntSize(800, 600));
m_cell = RenderTableCell::createAnonymous(&m_pageHolder->document());
}
virtual void TearDown()
......@@ -72,14 +50,10 @@ protected:
m_cell->destroy();
}
OwnPtr<DummyPageHolder> m_pageHolder;
RenderTableCell* m_cell;
private:
static FrameTestHelpers::WebViewHelper* s_webViewHelper;
};
FrameTestHelpers::WebViewHelper* RenderTableCellDeathTest::s_webViewHelper = 0;
TEST_F(RenderTableCellDeathTest, CanSetColumn)
{
static const unsigned columnIndex = 10;
......
......@@ -27,11 +27,7 @@
#include "core/rendering/RenderTableRow.h"
#include "core/frame/LocalFrame.h"
#include "public/web/WebFrame.h"
#include "public/web/WebView.h"
#include "web/WebLocalFrameImpl.h"
#include "web/tests/FrameTestHelpers.h"
#include "core/testing/DummyPageHolder.h"
#include <gtest/gtest.h>
......@@ -43,28 +39,10 @@ namespace {
class RenderTableRowDeathTest : public testing::Test {
protected:
static void SetUpTestCase()
{
// It's unfortunate that we have to get the whole browser stack to test one RenderObject
// but the code needs it.
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 toWebLocalFrameImpl(s_webViewHelper->webView()->mainFrame())->frame()->document();
}
virtual void SetUp()
{
m_row = RenderTableRow::createAnonymous(document());
m_pageHolder = DummyPageHolder::create(IntSize(800, 600));
m_row = RenderTableRow::createAnonymous(&m_pageHolder->document());
}
virtual void TearDown()
......@@ -72,14 +50,10 @@ protected:
m_row->destroy();
}
OwnPtr<DummyPageHolder> m_pageHolder;
RenderTableRow* m_row;
private:
static FrameTestHelpers::WebViewHelper* s_webViewHelper;
};
FrameTestHelpers::WebViewHelper* RenderTableRowDeathTest::s_webViewHelper = 0;
TEST_F(RenderTableRowDeathTest, CanSetRow)
{
static const unsigned rowIndex = 10;
......
......@@ -289,8 +289,6 @@
'tests/PopupMenuTest.cpp',
'tests/PrerenderingTest.cpp',
'tests/ProgrammaticScrollTest.cpp',
'tests/RenderTableCellTest.cpp',
'tests/RenderTableRowTest.cpp',
'tests/ScrollingCoordinatorChromiumTest.cpp',
'tests/SpinLockTest.cpp',
'tests/TextFinderTest.cpp',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment