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

Side by Side Diff: content/renderer/render_view_browsertest.cc

Issue 953233002: Add |needs_resize_ack| flag to ViewMsg_Resize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove DCHECK() Created 5 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 | « content/public/test/render_widget_test.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/memory/shared_memory.h" 8 #include "base/memory/shared_memory.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 2265 matching lines...) Expand 10 before | Expand all | Expand 10 after
2276 frame()->OnNavigate(late_nav_params); 2276 frame()->OnNavigate(late_nav_params);
2277 ProcessPendingMessages(); 2277 ProcessPendingMessages();
2278 base::Time after_navigation = 2278 base::Time after_navigation =
2279 base::Time::Now() + base::TimeDelta::FromDays(1); 2279 base::Time::Now() + base::TimeDelta::FromDays(1);
2280 2280
2281 base::Time late_nav_reported_start = 2281 base::Time late_nav_reported_start =
2282 base::Time::FromDoubleT(GetMainFrame()->performance().navigationStart()); 2282 base::Time::FromDoubleT(GetMainFrame()->performance().navigationStart());
2283 EXPECT_LE(late_nav_reported_start, after_navigation); 2283 EXPECT_LE(late_nav_reported_start, after_navigation);
2284 } 2284 }
2285 2285
2286 class RenderViewImplInitialSizeTest : public RenderViewImplTest {
2287 public:
2288 RenderViewImplInitialSizeTest()
2289 : RenderViewImplTest(), initial_size_(200, 100) {}
2290
2291 protected:
2292 scoped_ptr<ViewMsg_Resize_Params> InitialSizeParams() override {
2293 scoped_ptr<ViewMsg_Resize_Params> initial_size_params(
2294 new ViewMsg_Resize_Params());
2295 initial_size_params->new_size = initial_size_;
2296 return initial_size_params.Pass();
2297 }
2298
2299 gfx::Size initial_size_;
2300 };
2301
2302 TEST_F(RenderViewImplInitialSizeTest, InitialSize) {
2303 ASSERT_EQ(initial_size_, view_->GetSize());
2304 ASSERT_EQ(initial_size_, gfx::Size(view_->GetWebView()->size()));
2305 }
2306
2307 TEST_F(RenderViewImplTest, PreferredSizeZoomed) { 2286 TEST_F(RenderViewImplTest, PreferredSizeZoomed) {
2308 LoadHTML("<body style='margin:0;'><div style='display:inline-block; " 2287 LoadHTML("<body style='margin:0;'><div style='display:inline-block; "
2309 "width:400px; height:400px;'/></body>"); 2288 "width:400px; height:400px;'/></body>");
2310 view()->webview()->mainFrame()->setCanHaveScrollbars(false); 2289 view()->webview()->mainFrame()->setCanHaveScrollbars(false);
2311 EnablePreferredSizeMode(); 2290 EnablePreferredSizeMode();
2312 2291
2313 gfx::Size size = GetPreferredSize(); 2292 gfx::Size size = GetPreferredSize();
2314 EXPECT_EQ(gfx::Size(400, 400), size); 2293 EXPECT_EQ(gfx::Size(400, 400), size);
2315 2294
2316 SetZoomLevel(ZoomFactorToZoomLevel(2.0)); 2295 SetZoomLevel(ZoomFactorToZoomLevel(2.0));
2317 size = GetPreferredSize(); 2296 size = GetPreferredSize();
2318 EXPECT_EQ(gfx::Size(800, 800), size); 2297 EXPECT_EQ(gfx::Size(800, 800), size);
2319 } 2298 }
2320 2299
2321 } // namespace content 2300 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/render_widget_test.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698