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

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

Issue 28983004: Split the frame tree logic out of HistoryItem (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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
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 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after
1602 int viewportWidth = 640; 1602 int viewportWidth = 640;
1603 int viewportHeight = 480; 1603 int viewportHeight = 480;
1604 1604
1605 FrameTestHelpers::WebViewHelper webViewHelper; 1605 FrameTestHelpers::WebViewHelper webViewHelper;
1606 webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &c lient); 1606 webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &c lient);
1607 webViewHelper.webView()->settings()->setViewportEnabled(true); 1607 webViewHelper.webView()->settings()->setViewportEnabled(true);
1608 webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight)); 1608 webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
1609 webViewHelper.webView()->layout(); 1609 webViewHelper.webView()->layout();
1610 1610
1611 webViewHelper.webView()->setPageScaleFactor(3, WebPoint()); 1611 webViewHelper.webView()->setPageScaleFactor(3, WebPoint());
1612 webViewHelper.webViewImpl()->page()->mainFrame()->loader().history()->saveDo cumentAndScrollState(); 1612 webViewHelper.webViewImpl()->page()->history()->saveDocumentAndScrollState(w ebViewHelper.webViewImpl()->page()->mainFrame());
1613 webViewHelper.webView()->setPageScaleFactor(1, WebPoint()); 1613 webViewHelper.webView()->setPageScaleFactor(1, WebPoint());
1614 webViewHelper.webViewImpl()->page()->mainFrame()->loader().history()->restor eScrollPositionAndViewState(); 1614 webViewHelper.webViewImpl()->page()->history()->restoreScrollPositionAndView State(webViewHelper.webViewImpl()->page()->mainFrame());
1615 EXPECT_EQ(3, webViewHelper.webView()->pageScaleFactor()); 1615 EXPECT_EQ(3, webViewHelper.webView()->pageScaleFactor());
1616 } 1616 }
1617 1617
1618 TEST_F(WebFrameTest, pageScaleFactorShrinksViewport) 1618 TEST_F(WebFrameTest, pageScaleFactorShrinksViewport)
1619 { 1619 {
1620 UseMockScrollbarSettings mockScrollbarSettings; 1620 UseMockScrollbarSettings mockScrollbarSettings;
1621 registerMockedHttpURLLoad("large-div.html"); 1621 registerMockedHttpURLLoad("large-div.html");
1622 1622
1623 FixedLayoutTestWebViewClient client; 1623 FixedLayoutTestWebViewClient client;
1624 client.m_screenInfo.deviceScaleFactor = 1; 1624 client.m_screenInfo.deviceScaleFactor = 1;
(...skipping 3269 matching lines...) Expand 10 before | Expand all | Expand 10 after
4894 4894
4895 FrameTestHelpers::loadFrame(frame, 4895 FrameTestHelpers::loadFrame(frame,
4896 "javascript:window.frames[1].location.assign('" + m_baseURL + "find.html ')"); 4896 "javascript:window.frames[1].location.assign('" + m_baseURL + "find.html ')");
4897 runPendingTasks(); 4897 runPendingTasks();
4898 Platform::current()->unitTestSupport()->serveAsynchronousMockedRequests(); 4898 Platform::current()->unitTestSupport()->serveAsynchronousMockedRequests();
4899 EXPECT_EQ(client.frame(), iframe); 4899 EXPECT_EQ(client.frame(), iframe);
4900 EXPECT_FALSE(client.replacesCurrentHistoryItem()); 4900 EXPECT_FALSE(client.replacesCurrentHistoryItem());
4901 } 4901 }
4902 4902
4903 } // namespace 4903 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698