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

Unified Diff: content/test/layouttest_support.cc

Issue 14859017: [content shell] implement auto resize related WebTestDelegate interfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years, 7 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 | « content/shell/renderer/webkit_test_runner.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/layouttest_support.cc
diff --git a/content/test/layouttest_support.cc b/content/test/layouttest_support.cc
index a186e191ff4beeee921a6dbbe48902c310626307..b60a161abafa0a681a6e930cf790134952f8bfc0 100644
--- a/content/test/layouttest_support.cc
+++ b/content/test/layouttest_support.cc
@@ -24,6 +24,8 @@
#endif
using WebKit::WebGamepads;
+using WebKit::WebRect;
+using WebKit::WebSize;
using WebTestRunner::WebTestProxy;
using WebTestRunner::WebTestProxyBase;
@@ -95,8 +97,12 @@ void EnableShortCircuitSizeUpdates() {
}
void ForceResizeRenderView(RenderView* render_view,
- const WebKit::WebSize& new_size) {
- static_cast<RenderViewImpl*>(render_view)->didAutoResize(new_size);
+ const WebSize& new_size) {
+ RenderViewImpl* render_view_impl = static_cast<RenderViewImpl*>(render_view);
+ render_view_impl->setWindowRect(WebRect(render_view_impl->rootWindowRect().x,
+ render_view_impl->rootWindowRect().y,
+ new_size.width,
+ new_size.height));
}
void DisableNavigationErrorPages() {
@@ -120,4 +126,16 @@ void DisableModalPopupMenus() {
#endif
}
+void EnableAutoResizeMode(RenderView* render_view,
+ const WebSize& min_size,
+ const WebSize& max_size) {
+ static_cast<RenderViewImpl*>(render_view)
+ ->EnableAutoResizeForTesting(min_size, max_size);
+}
+
+void DisableAutoResizeMode(RenderView* render_view, const WebSize& new_size) {
+ static_cast<RenderViewImpl*>(render_view)
+ ->DisableAutoResizeForTesting(new_size);
+}
+
} // namespace content
« no previous file with comments | « content/shell/renderer/webkit_test_runner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698