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

Side by Side Diff: Source/web/tests/WebFrameTest.cpp

Issue 219223003: Add setting for fitting the content in the viewport width (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | no next file » | 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 669
670 WebScreenInfo m_screenInfo; 670 WebScreenInfo m_screenInfo;
671 }; 671 };
672 672
673 // Viewport settings need to be set before the page gets loaded 673 // Viewport settings need to be set before the page gets loaded
674 static void enableViewportSettings(WebSettings* settings) 674 static void enableViewportSettings(WebSettings* settings)
675 { 675 {
676 settings->setViewportMetaEnabled(true); 676 settings->setViewportMetaEnabled(true);
677 settings->setViewportEnabled(true); 677 settings->setViewportEnabled(true);
678 settings->setMainFrameResizesAreOrientationChanges(true); 678 settings->setMainFrameResizesAreOrientationChanges(true);
679 settings->setShrinksViewportContentToFit(true);
679 } 680 }
680 681
681 TEST_F(WebFrameTest, FrameViewNeedsLayoutOnFixedLayoutResize) 682 TEST_F(WebFrameTest, FrameViewNeedsLayoutOnFixedLayoutResize)
682 { 683 {
683 UseMockScrollbarSettings mockScrollbarSettings; 684 UseMockScrollbarSettings mockScrollbarSettings;
684 registerMockedHttpURLLoad("fixed_layout.html"); 685 registerMockedHttpURLLoad("fixed_layout.html");
685 686
686 FixedLayoutTestWebViewClient client; 687 FixedLayoutTestWebViewClient client;
687 int viewportWidth = 640; 688 int viewportWidth = 640;
688 int viewportHeight = 480; 689 int viewportHeight = 480;
(...skipping 4793 matching lines...) Expand 10 before | Expand all | Expand 10 after
5482 EXPECT_EQ(2U, container->percentHeightDescendants()->size()); 5483 EXPECT_EQ(2U, container->percentHeightDescendants()->size());
5483 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightInA nonymous)); 5484 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightInA nonymous));
5484 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightDir ectChild)); 5485 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightDir ectChild));
5485 5486
5486 WebCore::RenderBlock* anonymousBlock = percentHeightInAnonymous->containingB lock(); 5487 WebCore::RenderBlock* anonymousBlock = percentHeightInAnonymous->containingB lock();
5487 EXPECT_TRUE(anonymousBlock->isAnonymous()); 5488 EXPECT_TRUE(anonymousBlock->isAnonymous());
5488 EXPECT_FALSE(anonymousBlock->hasPercentHeightDescendants()); 5489 EXPECT_FALSE(anonymousBlock->hasPercentHeightDescendants());
5489 } 5490 }
5490 5491
5491 } // namespace 5492 } // namespace
OLDNEW
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698