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

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

Issue 2584513003: PlzNavigate: identify same-page browser-initiated navigation. (Closed)
Patch Set: Rebase. Created 3 years, 10 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/renderer/render_frame_impl.cc ('k') | content/renderer/render_view_browsertest.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/leak_annotations.h" 8 #include "base/debug/leak_annotations.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "content/child/web_url_loader_impl.h" 10 #include "content/child/web_url_loader_impl.h"
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 335
336 TEST_F(RenderFrameImplTest, ZoomLimit) { 336 TEST_F(RenderFrameImplTest, ZoomLimit) {
337 const double kMinZoomLevel = ZoomFactorToZoomLevel(kMinimumZoomFactor); 337 const double kMinZoomLevel = ZoomFactorToZoomLevel(kMinimumZoomFactor);
338 const double kMaxZoomLevel = ZoomFactorToZoomLevel(kMaximumZoomFactor); 338 const double kMaxZoomLevel = ZoomFactorToZoomLevel(kMaximumZoomFactor);
339 339
340 // Verifies navigation to a URL with preset zoom level indeed sets the level. 340 // Verifies navigation to a URL with preset zoom level indeed sets the level.
341 // Regression test for http://crbug.com/139559, where the level was not 341 // Regression test for http://crbug.com/139559, where the level was not
342 // properly set when it is out of the default zoom limits of WebView. 342 // properly set when it is out of the default zoom limits of WebView.
343 CommonNavigationParams common_params; 343 CommonNavigationParams common_params;
344 common_params.url = GURL("data:text/html,min_zoomlimit_test"); 344 common_params.url = GURL("data:text/html,min_zoomlimit_test");
345 common_params.navigation_type = FrameMsg_Navigate_Type::DIFFERENT_DOCUMENT;
345 GetMainRenderFrame()->SetHostZoomLevel(common_params.url, kMinZoomLevel); 346 GetMainRenderFrame()->SetHostZoomLevel(common_params.url, kMinZoomLevel);
346 GetMainRenderFrame()->NavigateInternal( 347 GetMainRenderFrame()->NavigateInternal(
347 common_params, StartNavigationParams(), RequestNavigationParams(), 348 common_params, StartNavigationParams(), RequestNavigationParams(),
348 std::unique_ptr<StreamOverrideParameters>()); 349 std::unique_ptr<StreamOverrideParameters>());
349 ProcessPendingMessages(); 350 ProcessPendingMessages();
350 EXPECT_DOUBLE_EQ(kMinZoomLevel, view_->GetWebView()->zoomLevel()); 351 EXPECT_DOUBLE_EQ(kMinZoomLevel, view_->GetWebView()->zoomLevel());
351 352
352 // It should work even when the zoom limit is temporarily changed in the page. 353 // It should work even when the zoom limit is temporarily changed in the page.
353 view_->GetWebView()->zoomLimitsChanged(ZoomFactorToZoomLevel(1.0), 354 view_->GetWebView()->zoomLimitsChanged(ZoomFactorToZoomLevel(1.0),
354 ZoomFactorToZoomLevel(1.0)); 355 ZoomFactorToZoomLevel(1.0));
355 common_params.url = GURL("data:text/html,max_zoomlimit_test"); 356 common_params.url = GURL("data:text/html,max_zoomlimit_test");
356 GetMainRenderFrame()->SetHostZoomLevel(common_params.url, kMaxZoomLevel); 357 GetMainRenderFrame()->SetHostZoomLevel(common_params.url, kMaxZoomLevel);
357 GetMainRenderFrame()->NavigateInternal( 358 GetMainRenderFrame()->NavigateInternal(
358 common_params, StartNavigationParams(), RequestNavigationParams(), 359 common_params, StartNavigationParams(), RequestNavigationParams(),
359 std::unique_ptr<StreamOverrideParameters>()); 360 std::unique_ptr<StreamOverrideParameters>());
360 ProcessPendingMessages(); 361 ProcessPendingMessages();
361 EXPECT_DOUBLE_EQ(kMaxZoomLevel, view_->GetWebView()->zoomLevel()); 362 EXPECT_DOUBLE_EQ(kMaxZoomLevel, view_->GetWebView()->zoomLevel());
362 } 363 }
363 364
364 } // namespace 365 } // namespace
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698