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

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

Issue 190723007: Fix tests to be compatible with Android scale initialization. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove substantive change, change only tests Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/web/tests/TouchActionTest.cpp ('k') | Source/web/tests/WebViewTest.cpp » ('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) 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 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after
1584 webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight)); 1584 webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
1585 webViewHelper.webView()->layout(); 1585 webViewHelper.webView()->layout();
1586 1586
1587 int prevLayoutCount = webViewHelper.webViewImpl()->mainFrameImpl()->frameVie w()->layoutCount(); 1587 int prevLayoutCount = webViewHelper.webViewImpl()->mainFrameImpl()->frameVie w()->layoutCount();
1588 webViewHelper.webViewImpl()->setPageScaleFactor(30); 1588 webViewHelper.webViewImpl()->setPageScaleFactor(30);
1589 EXPECT_FALSE(webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->need sLayout()); 1589 EXPECT_FALSE(webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->need sLayout());
1590 EXPECT_EQ(prevLayoutCount, webViewHelper.webViewImpl()->mainFrameImpl()->fra meView()->layoutCount()); 1590 EXPECT_EQ(prevLayoutCount, webViewHelper.webViewImpl()->mainFrameImpl()->fra meView()->layoutCount());
1591 1591
1592 } 1592 }
1593 1593
1594 TEST_F(WebFrameTest, setPageScaleFactorBeforeFrameHasView)
1595 {
1596 registerMockedHttpURLLoad("fixed_layout.html");
1597
1598 float pageScaleFactor = 3;
1599 FrameTestHelpers::WebViewHelper webViewHelper;
1600 webViewHelper.initializeAndLoad("about:html", true, 0, 0);
1601 webViewHelper.webView()->setPageScaleFactor(pageScaleFactor);
1602
1603 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "fixed_layout.html");
1604 WebCore::FrameView* view = webViewHelper.webViewImpl()->mainFrameImpl()->fra meView();
1605 EXPECT_EQ(pageScaleFactor, view->visibleContentScaleFactor());
1606 }
1607
1608 TEST_F(WebFrameTest, pageScaleFactorWrittenToHistoryItem) 1594 TEST_F(WebFrameTest, pageScaleFactorWrittenToHistoryItem)
1609 { 1595 {
1610 UseMockScrollbarSettings mockScrollbarSettings; 1596 UseMockScrollbarSettings mockScrollbarSettings;
1611 registerMockedHttpURLLoad("fixed_layout.html"); 1597 registerMockedHttpURLLoad("fixed_layout.html");
1612 1598
1613 FixedLayoutTestWebViewClient client; 1599 FixedLayoutTestWebViewClient client;
1614 client.m_screenInfo.deviceScaleFactor = 1; 1600 client.m_screenInfo.deviceScaleFactor = 1;
1615 int viewportWidth = 640; 1601 int viewportWidth = 640;
1616 int viewportHeight = 480; 1602 int viewportHeight = 480;
1617 1603
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
2169 2155
2170 registerMockedHttpURLLoad("large-div.html"); 2156 registerMockedHttpURLLoad("large-div.html");
2171 2157
2172 int viewWidth = 500; 2158 int viewWidth = 500;
2173 int viewHeight = 500; 2159 int viewHeight = 500;
2174 2160
2175 OwnPtr<FakeCompositingWebViewClient> fakeCompositingWebViewClient = adoptPtr (new FakeCompositingWebViewClient()); 2161 OwnPtr<FakeCompositingWebViewClient> fakeCompositingWebViewClient = adoptPtr (new FakeCompositingWebViewClient());
2176 FrameTestHelpers::WebViewHelper webViewHelper; 2162 FrameTestHelpers::WebViewHelper webViewHelper;
2177 webViewHelper.initialize(true, 0, fakeCompositingWebViewClient.get(), &confi gueCompositingWebView); 2163 webViewHelper.initialize(true, 0, fakeCompositingWebViewClient.get(), &confi gueCompositingWebView);
2178 2164
2165 webViewHelper.webView()->setPageScaleFactorLimits(1, 1);
2179 webViewHelper.webView()->resize(WebSize(viewWidth, viewHeight)); 2166 webViewHelper.webView()->resize(WebSize(viewWidth, viewHeight));
2180 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "large-div.html"); 2167 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "large-div.html");
2181 2168
2182 WebCore::FrameView* view = webViewHelper.webViewImpl()->mainFrameImpl()->fra meView(); 2169 WebCore::FrameView* view = webViewHelper.webViewImpl()->mainFrameImpl()->fra meView();
2183 EXPECT_TRUE(view->renderView()->compositor()->layerForHorizontalScrollbar()) ; 2170 EXPECT_TRUE(view->renderView()->compositor()->layerForHorizontalScrollbar()) ;
2184 EXPECT_TRUE(view->renderView()->compositor()->layerForVerticalScrollbar()); 2171 EXPECT_TRUE(view->renderView()->compositor()->layerForVerticalScrollbar());
2185 2172
2186 webViewHelper.webView()->resize(WebSize(viewWidth * 10, viewHeight * 10)); 2173 webViewHelper.webView()->resize(WebSize(viewWidth * 10, viewHeight * 10));
2187 webViewHelper.webView()->layout(); 2174 webViewHelper.webView()->layout();
2188 EXPECT_FALSE(view->renderView()->compositor()->layerForHorizontalScrollbar() ); 2175 EXPECT_FALSE(view->renderView()->compositor()->layerForHorizontalScrollbar() );
(...skipping 3213 matching lines...) Expand 10 before | Expand all | Expand 10 after
5402 registerMockedHttpURLLoad("link-manifest-change.html"); 5389 registerMockedHttpURLLoad("link-manifest-change.html");
5403 5390
5404 ManifestChangeWebFrameClient webFrameClient; 5391 ManifestChangeWebFrameClient webFrameClient;
5405 FrameTestHelpers::WebViewHelper webViewHelper; 5392 FrameTestHelpers::WebViewHelper webViewHelper;
5406 webViewHelper.initializeAndLoad(m_baseURL + "link-manifest-change.html", tru e, &webFrameClient); 5393 webViewHelper.initializeAndLoad(m_baseURL + "link-manifest-change.html", tru e, &webFrameClient);
5407 5394
5408 EXPECT_EQ(14, webFrameClient.manifestChangeCount()); 5395 EXPECT_EQ(14, webFrameClient.manifestChangeCount());
5409 } 5396 }
5410 5397
5411 } // namespace 5398 } // namespace
OLDNEW
« no previous file with comments | « Source/web/tests/TouchActionTest.cpp ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698