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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebViewTest.cpp

Issue 2738133002: Provide an overload to WebView::create that does not require a WebViewClient. (Closed)
Patch Set: Add a derived WebViewClient and use it when no client is passed. Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | third_party/WebKit/public/web/WebView.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 2082 matching lines...) Expand 10 before | Expand all | Expand 10 after
2093 webView->handleInputEvent(WebCoalescedInputEvent(event)); 2093 webView->handleInputEvent(WebCoalescedInputEvent(event));
2094 runPendingTasks(); 2094 runPendingTasks();
2095 EXPECT_EQ(25, client.longpressX()); 2095 EXPECT_EQ(25, client.longpressX());
2096 EXPECT_EQ(7, client.longpressY()); 2096 EXPECT_EQ(7, client.longpressY());
2097 2097
2098 // Explicitly reset to break dependency on locally scoped client. 2098 // Explicitly reset to break dependency on locally scoped client.
2099 m_webViewHelper.reset(); 2099 m_webViewHelper.reset();
2100 } 2100 }
2101 2101
2102 TEST_P(WebViewTest, ClientTapHandlingNullWebViewClient) { 2102 TEST_P(WebViewTest, ClientTapHandlingNullWebViewClient) {
2103 WebViewImpl* webView = 2103 WebViewImpl* webView = WebViewImpl::create(WebPageVisibilityStateVisible);
2104 WebViewImpl::create(nullptr, WebPageVisibilityStateVisible);
2105 FrameTestHelpers::TestWebFrameClient webFrameClient; 2104 FrameTestHelpers::TestWebFrameClient webFrameClient;
2106 FrameTestHelpers::TestWebWidgetClient webWidgetClient; 2105 FrameTestHelpers::TestWebWidgetClient webWidgetClient;
2107 WebLocalFrame* localFrame = WebLocalFrame::create( 2106 WebLocalFrame* localFrame = WebLocalFrame::create(
2108 WebTreeScopeType::Document, &webFrameClient, nullptr, nullptr); 2107 WebTreeScopeType::Document, &webFrameClient, nullptr, nullptr);
2109 webView->setMainFrame(localFrame); 2108 webView->setMainFrame(localFrame);
2110 2109
2111 // TODO(dcheng): The main frame widget currently has a special case. 2110 // TODO(dcheng): The main frame widget currently has a special case.
2112 // Eliminate this once WebView is no longer a WebWidget. 2111 // Eliminate this once WebView is no longer a WebWidget.
2113 blink::WebFrameWidget::create(&webWidgetClient, webView, localFrame); 2112 blink::WebFrameWidget::create(&webWidgetClient, webView, localFrame);
2114 2113
(...skipping 2218 matching lines...) Expand 10 before | Expand all | Expand 10 after
4333 EXPECT_FALSE(frameView->visualViewportSuppliesScrollbars()); 4332 EXPECT_FALSE(frameView->visualViewportSuppliesScrollbars());
4334 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { 4333 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
4335 EXPECT_NE(nullptr, 4334 EXPECT_NE(nullptr,
4336 frameView->layoutViewportScrollableArea()->verticalScrollbar()); 4335 frameView->layoutViewportScrollableArea()->verticalScrollbar());
4337 } else { 4336 } else {
4338 EXPECT_NE(nullptr, frameView->verticalScrollbar()); 4337 EXPECT_NE(nullptr, frameView->verticalScrollbar());
4339 } 4338 }
4340 } 4339 }
4341 4340
4342 } // namespace blink 4341 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | third_party/WebKit/public/web/WebView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698