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

Unified Diff: third_party/WebKit/Source/web/tests/WebViewTest.cpp

Issue 2389493002: Revert of Require WebLocalFrame to be created with a non-null client (Closed)
Patch Set: Created 4 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: third_party/WebKit/Source/web/tests/WebViewTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebViewTest.cpp b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
index 85c3507d14405481e44e32399b51b0f45cc00c72..424d1c53d8df322a0f3e76d556267ae9a27dbf05 100644
--- a/third_party/WebKit/Source/web/tests/WebViewTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
@@ -413,10 +413,10 @@
// webView does not have a frame yet, but we should still be able to set the background color.
webView->setBaseBackgroundColor(kBlue);
EXPECT_EQ(kBlue, webView->backgroundColor());
- FrameTestHelpers::TestWebFrameClient webFrameClient;
- WebLocalFrame* frame = WebLocalFrame::create(WebTreeScopeType::Document, &webFrameClient);
+ WebLocalFrame* frame = WebLocalFrame::create(WebTreeScopeType::Document, nullptr);
webView->setMainFrame(frame);
webView->close();
+ frame->close();
}
TEST_F(WebViewTest, SetBaseBackgroundColorAndBlendWithExistingContent)
@@ -1827,8 +1827,7 @@
TEST_F(WebViewTest, ClientTapHandlingNullWebViewClient)
{
WebViewImpl* webView = WebViewImpl::create(nullptr, WebPageVisibilityStateVisible);
- FrameTestHelpers::TestWebFrameClient webFrameClient;
- WebLocalFrame* localFrame = WebLocalFrame::create(WebTreeScopeType::Document, &webFrameClient);
+ WebLocalFrame* localFrame = WebLocalFrame::create(WebTreeScopeType::Document, nullptr);
webView->setMainFrame(localFrame);
WebGestureEvent event;
event.type = WebInputEvent::GestureTap;
@@ -1837,6 +1836,8 @@
event.y = 8;
EXPECT_EQ(WebInputEventResult::NotHandled, webView->handleInputEvent(event));
webView->close();
+ // Explicitly close as the frame as no frame client to do so on frameDetached().
+ localFrame->close();
}
TEST_F(WebViewTest, LongPressEmptyDiv)
@@ -2721,7 +2722,7 @@
class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClient {
public:
CreateChildCounterFrameClient() : m_count(0) { }
- WebLocalFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const WebString& name, const WebString& uniqueName, WebSandboxFlags, const WebFrameOwnerProperties&) override;
+ WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const WebString& name, const WebString& uniqueName, WebSandboxFlags, const WebFrameOwnerProperties&) override;
int count() const { return m_count; }
@@ -2729,7 +2730,7 @@
int m_count;
};
-WebLocalFrame* CreateChildCounterFrameClient::createChildFrame(WebLocalFrame* parent, WebTreeScopeType scope, const WebString& name, const WebString& uniqueName, WebSandboxFlags sandboxFlags, const WebFrameOwnerProperties& frameOwnerProperties)
+WebFrame* CreateChildCounterFrameClient::createChildFrame(WebLocalFrame* parent, WebTreeScopeType scope, const WebString& name, const WebString& uniqueName, WebSandboxFlags sandboxFlags, const WebFrameOwnerProperties& frameOwnerProperties)
{
++m_count;
return TestWebFrameClient::createChildFrame(parent, scope, name, uniqueName, sandboxFlags, frameOwnerProperties);
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebFrameTest.cpp ('k') | third_party/WebKit/public/web/WebFrameClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698