| 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 WebView* webView = m_webViewHelper.initializeAndLoad(url, true); | 2342 WebView* webView = m_webViewHelper.initializeAndLoad(url, true); |
| 2343 | 2343 |
| 2344 WebSize size = webView->contentsPreferredMinimumSize(); | 2344 WebSize size = webView->contentsPreferredMinimumSize(); |
| 2345 EXPECT_EQ(100, size.width); | 2345 EXPECT_EQ(100, size.width); |
| 2346 EXPECT_EQ(100, size.height); | 2346 EXPECT_EQ(100, size.height); |
| 2347 | 2347 |
| 2348 webView->setZoomLevel(WebView::zoomFactorToZoomLevel(2.0)); | 2348 webView->setZoomLevel(WebView::zoomFactorToZoomLevel(2.0)); |
| 2349 size = webView->contentsPreferredMinimumSize(); | 2349 size = webView->contentsPreferredMinimumSize(); |
| 2350 EXPECT_EQ(200, size.width); | 2350 EXPECT_EQ(200, size.width); |
| 2351 EXPECT_EQ(200, size.height); | 2351 EXPECT_EQ(200, size.height); |
| 2352 |
| 2353 url = m_baseURL + "specify_size.html?1.5px:1.5px"; |
| 2354 URLTestHelpers::registerMockedURLLoad(toKURL(url), "specify_size.html"); |
| 2355 webView = m_webViewHelper.initializeAndLoad(url, true); |
| 2356 |
| 2357 webView->setZoomLevel(WebView::zoomFactorToZoomLevel(1)); |
| 2358 size = webView->contentsPreferredMinimumSize(); |
| 2359 EXPECT_EQ(2, size.width); |
| 2360 EXPECT_EQ(2, size.height); |
| 2352 } | 2361 } |
| 2353 | 2362 |
| 2354 class UnhandledTapWebViewClient : public FrameTestHelpers::TestWebViewClient { | 2363 class UnhandledTapWebViewClient : public FrameTestHelpers::TestWebViewClient { |
| 2355 public: | 2364 public: |
| 2356 virtual void showUnhandledTapUIIfNeeded(const WebPoint& tappedPosition, cons
t WebNode& tappedNode, bool pageChanged) override | 2365 virtual void showUnhandledTapUIIfNeeded(const WebPoint& tappedPosition, cons
t WebNode& tappedNode, bool pageChanged) override |
| 2357 { | 2366 { |
| 2358 m_wasCalled = true; | 2367 m_wasCalled = true; |
| 2359 m_tappedPosition = tappedPosition; | 2368 m_tappedPosition = tappedPosition; |
| 2360 m_tappedNode = tappedNode; | 2369 m_tappedNode = tappedNode; |
| 2361 m_pageChanged = pageChanged; | 2370 m_pageChanged = pageChanged; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2513 // Test without any preventDefault. | 2522 // Test without any preventDefault. |
| 2514 client.reset(); | 2523 client.reset(); |
| 2515 frame->executeScript(WebScriptSource("setTest('none');")); | 2524 frame->executeScript(WebScriptSource("setTest('none');")); |
| 2516 EXPECT_TRUE(tapElementById(webView, WebInputEvent::GestureTap, WebString::fr
omUTF8("target"))); | 2525 EXPECT_TRUE(tapElementById(webView, WebInputEvent::GestureTap, WebString::fr
omUTF8("target"))); |
| 2517 EXPECT_TRUE(client.getWasCalled()); | 2526 EXPECT_TRUE(client.getWasCalled()); |
| 2518 | 2527 |
| 2519 m_webViewHelper.reset(); // Remove dependency on locally scoped client. | 2528 m_webViewHelper.reset(); // Remove dependency on locally scoped client. |
| 2520 } | 2529 } |
| 2521 | 2530 |
| 2522 } // namespace | 2531 } // namespace |
| OLD | NEW |