| 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 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1644 "-webkit-text-stroke-width: 0px;\">Price 10,000,000won</div>"; | 1644 "-webkit-text-stroke-width: 0px;\">Price 10,000,000won</div>"; |
| 1645 WebString clipText; | 1645 WebString clipText; |
| 1646 WebString clipHtml; | 1646 WebString clipHtml; |
| 1647 WebRect clipRect; | 1647 WebRect clipRect; |
| 1648 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("Ahem.ttf")); | 1648 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("Ahem.ttf")); |
| 1649 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("smartclip.html")); | 1649 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("smartclip.html")); |
| 1650 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "smartclip.
html"); | 1650 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "smartclip.
html"); |
| 1651 webView->setPageScaleFactorLimits(1, 1); | 1651 webView->setPageScaleFactorLimits(1, 1); |
| 1652 webView->resize(WebSize(500, 500)); | 1652 webView->resize(WebSize(500, 500)); |
| 1653 webView->layout(); | 1653 webView->layout(); |
| 1654 WebRect cropRect(300, 125, 100, 50); | 1654 WebRect cropRect(300, 125, 152, 50); |
| 1655 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect); | 1655 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect); |
| 1656 EXPECT_STREQ(kExpectedClipText, clipText.utf8().c_str()); | 1656 EXPECT_STREQ(kExpectedClipText, clipText.utf8().c_str()); |
| 1657 EXPECT_STREQ(kExpectedClipHtml, clipHtml.utf8().c_str()); | 1657 EXPECT_STREQ(kExpectedClipHtml, clipHtml.utf8().c_str()); |
| 1658 } | 1658 } |
| 1659 | 1659 |
| 1660 TEST_F(WebViewTest, SmartClipReturnsEmptyStringsWhenUserSelectIsNone) | 1660 TEST_F(WebViewTest, SmartClipReturnsEmptyStringsWhenUserSelectIsNone) |
| 1661 { | 1661 { |
| 1662 WebString clipText; | 1662 WebString clipText; |
| 1663 WebString clipHtml; | 1663 WebString clipHtml; |
| 1664 WebRect clipRect; | 1664 WebRect clipRect; |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2215 loadFrame(webView->mainFrame(), url); | 2215 loadFrame(webView->mainFrame(), url); |
| 2216 | 2216 |
| 2217 FrameView* frameView = m_webViewHelper.webViewImpl()->mainFrameImpl()->frame
View(); | 2217 FrameView* frameView = m_webViewHelper.webViewImpl()->mainFrameImpl()->frame
View(); |
| 2218 | 2218 |
| 2219 // Auto-resizing used to ASSERT(needsLayout()) in RenderBlockFlow::layout. T
his EXPECT is | 2219 // Auto-resizing used to ASSERT(needsLayout()) in RenderBlockFlow::layout. T
his EXPECT is |
| 2220 // merely a dummy. The real test is that we don't trigger asserts in debug b
uilds. | 2220 // merely a dummy. The real test is that we don't trigger asserts in debug b
uilds. |
| 2221 EXPECT_FALSE(frameView->needsLayout()); | 2221 EXPECT_FALSE(frameView->needsLayout()); |
| 2222 }; | 2222 }; |
| 2223 | 2223 |
| 2224 } // namespace | 2224 } // namespace |
| OLD | NEW |