Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 2331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2342 | 2342 |
| 2343 WebSize size = webView->contentsPreferredMinimumSize(); | 2343 WebSize size = webView->contentsPreferredMinimumSize(); |
| 2344 EXPECT_EQ(100, size.width); | 2344 EXPECT_EQ(100, size.width); |
| 2345 EXPECT_EQ(100, size.height); | 2345 EXPECT_EQ(100, size.height); |
| 2346 | 2346 |
| 2347 webView->setZoomLevel(WebView::zoomFactorToZoomLevel(2.0)); | 2347 webView->setZoomLevel(WebView::zoomFactorToZoomLevel(2.0)); |
| 2348 size = webView->contentsPreferredMinimumSize(); | 2348 size = webView->contentsPreferredMinimumSize(); |
| 2349 EXPECT_EQ(200, size.width); | 2349 EXPECT_EQ(200, size.width); |
| 2350 EXPECT_EQ(200, size.height); | 2350 EXPECT_EQ(200, size.height); |
| 2351 | 2351 |
| 2352 // Verify that both width and height are rounded | |
| 2353 webView->setZoomLevel(WebView::zoomFactorToZoomLevel(0.9995)); | |
|
leviw_travelin_and_unemployed
2015/05/20 22:05:06
Can we get some more test cases? 1.0005 maybe?
| |
| 2354 size = webView->contentsPreferredMinimumSize(); | |
| 2355 EXPECT_EQ(100, size.width); | |
| 2356 EXPECT_EQ(100, size.height); | |
| 2357 | |
| 2352 url = m_baseURL + "specify_size.html?1.5px:1.5px"; | 2358 url = m_baseURL + "specify_size.html?1.5px:1.5px"; |
| 2353 URLTestHelpers::registerMockedURLLoad(toKURL(url), "specify_size.html"); | 2359 URLTestHelpers::registerMockedURLLoad(toKURL(url), "specify_size.html"); |
| 2354 webView = m_webViewHelper.initializeAndLoad(url, true); | 2360 webView = m_webViewHelper.initializeAndLoad(url, true); |
| 2355 | 2361 |
| 2356 webView->setZoomLevel(WebView::zoomFactorToZoomLevel(1)); | 2362 webView->setZoomLevel(WebView::zoomFactorToZoomLevel(1)); |
| 2357 size = webView->contentsPreferredMinimumSize(); | 2363 size = webView->contentsPreferredMinimumSize(); |
| 2358 EXPECT_EQ(2, size.width); | 2364 EXPECT_EQ(2, size.width); |
| 2359 EXPECT_EQ(2, size.height); | 2365 EXPECT_EQ(2, size.height); |
| 2360 } | 2366 } |
| 2361 | 2367 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2521 // Test without any preventDefault. | 2527 // Test without any preventDefault. |
| 2522 client.reset(); | 2528 client.reset(); |
| 2523 frame->executeScript(WebScriptSource("setTest('none');")); | 2529 frame->executeScript(WebScriptSource("setTest('none');")); |
| 2524 EXPECT_TRUE(tapElementById(webView, WebInputEvent::GestureTap, WebString::fr omUTF8("target"))); | 2530 EXPECT_TRUE(tapElementById(webView, WebInputEvent::GestureTap, WebString::fr omUTF8("target"))); |
| 2525 EXPECT_TRUE(client.getWasCalled()); | 2531 EXPECT_TRUE(client.getWasCalled()); |
| 2526 | 2532 |
| 2527 m_webViewHelper.reset(); // Remove dependency on locally scoped client. | 2533 m_webViewHelper.reset(); // Remove dependency on locally scoped client. |
| 2528 } | 2534 } |
| 2529 | 2535 |
| 2530 } // namespace | 2536 } // namespace |
| OLD | NEW |