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

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

Issue 23506013: Make the embedder responsible for creating the WebFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix lifetime on frame detach 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
« no previous file with comments | « Source/web/tests/RenderTableCellTest.cpp ('k') | Source/web/tests/ScrollingCoordinatorChromiumTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/RenderTableRowTest.cpp
diff --git a/Source/web/tests/RenderTableRowTest.cpp b/Source/web/tests/RenderTableRowTest.cpp
index 912e27a95f9a9a0dd371683120038f3aa97d9d0a..4107664beb8488f95ef88f41bde406105ade56dd 100644
--- a/Source/web/tests/RenderTableRowTest.cpp
+++ b/Source/web/tests/RenderTableRowTest.cpp
@@ -43,23 +43,24 @@ namespace WebCore {
namespace {
class RenderTableRowDeathTest : 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()
+protected:
+ static void SetUpTestCase()
{
- static WebView* webView;
-
- if (webView)
- return toWebFrameImpl(webView->mainFrame())->frame();
+ // 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 +73,14 @@ class RenderTableRowDeathTest : public testing::Test {
m_row->destroy();
}
-protected:
RenderTableRow* m_row;
+
+private:
+ static FrameTestHelpers::WebViewHelper* s_webViewHelper;
};
+FrameTestHelpers::WebViewHelper* RenderTableRowDeathTest::s_webViewHelper = 0;
+
TEST_F(RenderTableRowDeathTest, CanSetRow)
{
static const unsigned rowIndex = 10;
« no previous file with comments | « Source/web/tests/RenderTableCellTest.cpp ('k') | Source/web/tests/ScrollingCoordinatorChromiumTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698