| OLD | NEW |
| 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 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1432 int viewportWidth = 640; | 1432 int viewportWidth = 640; |
| 1433 int viewportHeight = 480; | 1433 int viewportHeight = 480; |
| 1434 | 1434 |
| 1435 FrameTestHelpers::WebViewHelper webViewHelper; | 1435 FrameTestHelpers::WebViewHelper webViewHelper; |
| 1436 webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &c
lient); | 1436 webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &c
lient); |
| 1437 webViewHelper.webView()->settings()->setViewportEnabled(true); | 1437 webViewHelper.webView()->settings()->setViewportEnabled(true); |
| 1438 webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight)); | 1438 webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight)); |
| 1439 webViewHelper.webView()->layout(); | 1439 webViewHelper.webView()->layout(); |
| 1440 | 1440 |
| 1441 webViewHelper.webView()->setPageScaleFactor(3, WebPoint()); | 1441 webViewHelper.webView()->setPageScaleFactor(3, WebPoint()); |
| 1442 webViewHelper.webViewImpl()->page()->mainFrame()->loader().history()->saveDo
cumentAndScrollState(); | 1442 webViewHelper.webViewImpl()->page()->history()->saveDocumentAndScrollState(w
ebViewHelper.webViewImpl()->page()->mainFrame()); |
| 1443 webViewHelper.webView()->setPageScaleFactor(1, WebPoint()); | 1443 webViewHelper.webView()->setPageScaleFactor(1, WebPoint()); |
| 1444 webViewHelper.webViewImpl()->page()->mainFrame()->loader().history()->restor
eScrollPositionAndViewState(); | 1444 webViewHelper.webViewImpl()->page()->history()->restoreScrollPositionAndView
State(webViewHelper.webViewImpl()->page()->mainFrame()); |
| 1445 EXPECT_EQ(3, webViewHelper.webView()->pageScaleFactor()); | 1445 EXPECT_EQ(3, webViewHelper.webView()->pageScaleFactor()); |
| 1446 } | 1446 } |
| 1447 | 1447 |
| 1448 TEST_F(WebFrameTest, pageScaleFactorShrinksViewport) | 1448 TEST_F(WebFrameTest, pageScaleFactorShrinksViewport) |
| 1449 { | 1449 { |
| 1450 UseMockScrollbarSettings mockScrollbarSettings; | 1450 UseMockScrollbarSettings mockScrollbarSettings; |
| 1451 registerMockedHttpURLLoad("large-div.html"); | 1451 registerMockedHttpURLLoad("large-div.html"); |
| 1452 | 1452 |
| 1453 FixedLayoutTestWebViewClient client; | 1453 FixedLayoutTestWebViewClient client; |
| 1454 client.m_screenInfo.deviceScaleFactor = 1; | 1454 client.m_screenInfo.deviceScaleFactor = 1; |
| (...skipping 3143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4598 | 4598 |
| 4599 FrameTestHelpers::loadFrame(frame, | 4599 FrameTestHelpers::loadFrame(frame, |
| 4600 "javascript:window.frames[1].location.assign('" + m_baseURL + "find.html
')"); | 4600 "javascript:window.frames[1].location.assign('" + m_baseURL + "find.html
')"); |
| 4601 runPendingTasks(); | 4601 runPendingTasks(); |
| 4602 Platform::current()->unitTestSupport()->serveAsynchronousMockedRequests(); | 4602 Platform::current()->unitTestSupport()->serveAsynchronousMockedRequests(); |
| 4603 EXPECT_EQ(client.frame(), iframe); | 4603 EXPECT_EQ(client.frame(), iframe); |
| 4604 EXPECT_FALSE(client.replacesCurrentHistoryItem()); | 4604 EXPECT_FALSE(client.replacesCurrentHistoryItem()); |
| 4605 } | 4605 } |
| 4606 | 4606 |
| 4607 } // namespace | 4607 } // namespace |
| OLD | NEW |