Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1179)

Unified Diff: Source/web/tests/RenderTableCellTest.cpp

Issue 23506013: Make the embedder responsible for creating the WebFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add WebViewHelper for unittests. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/web/tests/RenderTableCellTest.cpp
diff --git a/Source/web/tests/RenderTableCellTest.cpp b/Source/web/tests/RenderTableCellTest.cpp
index fa0bcc8f1b6622ac5617cff6c0f228365b77ce5f..eca741101117393accc52dedb376ee2a4a927703 100644
--- a/Source/web/tests/RenderTableCellTest.cpp
+++ b/Source/web/tests/RenderTableCellTest.cpp
@@ -43,23 +43,22 @@ namespace WebCore {
namespace {
class RenderTableCellDeathTest : public testing::Test {
- // It's unfortunate that we have to get the whole browser stack to test one RenderObject
- // but the code needs it.
- static Frame* frame()
- {
- static WebView* webView;
-
- if (webView)
- return toWebFrameImpl(webView->mainFrame())->frame();
+ 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);
+ }
- webView = FrameTestHelpers::createWebViewAndLoad("about:blank");
- webView->setFocus(true);
- return toWebFrameImpl(webView->mainFrame())->frame();
+ static void TearDownTestCase() {
+ delete s_webViewHelper;
}
static Document* document()
{
- return frame()->document();
+ return toWebFrameImpl(s_webViewHelper->webView()->mainFrame())->frame()->document();
}
virtual void SetUp()
@@ -72,10 +71,14 @@ class RenderTableCellDeathTest : public testing::Test {
m_cell->destroy();
}
-protected:
RenderTableCell* m_cell;
+
+private:
+ static FrameTestHelpers::WebViewHelper* s_webViewHelper;
};
+FrameTestHelpers::WebViewHelper* RenderTableCellDeathTest::s_webViewHelper = 0;
+
TEST_F(RenderTableCellDeathTest, CanSetColumn)
{
static const unsigned columnIndex = 10;

Powered by Google App Engine
This is Rietveld 408576698