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 1597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1608 "-webkit-text-stroke-width: 0px;\">Price 10,000,000won</div>"; | 1608 "-webkit-text-stroke-width: 0px;\">Price 10,000,000won</div>"; |
1609 WebString clipText; | 1609 WebString clipText; |
1610 WebString clipHtml; | 1610 WebString clipHtml; |
1611 WebRect clipRect; | 1611 WebRect clipRect; |
1612 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("Ahem.ttf")); | 1612 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("Ahem.ttf")); |
1613 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("smartclip.html")); | 1613 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("smartclip.html")); |
1614 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "smartclip. html"); | 1614 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "smartclip. html"); |
1615 webView->setPageScaleFactorLimits(1, 1); | 1615 webView->setPageScaleFactorLimits(1, 1); |
1616 webView->resize(WebSize(500, 500)); | 1616 webView->resize(WebSize(500, 500)); |
1617 webView->layout(); | 1617 webView->layout(); |
1618 WebRect cropRect(300, 125, 100, 50); | 1618 WebRect cropRect(300, 125, 152, 50); |
trchen
2014/09/17 07:02:57
Note: We had a bit rot in Ahem.ttf that it was nev
| |
1619 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect); | 1619 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect); |
1620 EXPECT_STREQ(kExpectedClipText, clipText.utf8().c_str()); | 1620 EXPECT_STREQ(kExpectedClipText, clipText.utf8().c_str()); |
1621 EXPECT_STREQ(kExpectedClipHtml, clipHtml.utf8().c_str()); | 1621 EXPECT_STREQ(kExpectedClipHtml, clipHtml.utf8().c_str()); |
1622 } | 1622 } |
1623 | 1623 |
1624 TEST_F(WebViewTest, SmartClipReturnsEmptyStringsWhenUserSelectIsNone) | 1624 TEST_F(WebViewTest, SmartClipReturnsEmptyStringsWhenUserSelectIsNone) |
1625 { | 1625 { |
1626 WebString clipText; | 1626 WebString clipText; |
1627 WebString clipHtml; | 1627 WebString clipHtml; |
1628 WebRect clipRect; | 1628 WebRect clipRect; |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2179 loadFrame(webView->mainFrame(), url); | 2179 loadFrame(webView->mainFrame(), url); |
2180 | 2180 |
2181 FrameView* frameView = m_webViewHelper.webViewImpl()->mainFrameImpl()->frame View(); | 2181 FrameView* frameView = m_webViewHelper.webViewImpl()->mainFrameImpl()->frame View(); |
2182 | 2182 |
2183 // Auto-resizing used to ASSERT(needsLayout()) in RenderBlockFlow::layout. T his EXPECT is | 2183 // Auto-resizing used to ASSERT(needsLayout()) in RenderBlockFlow::layout. T his EXPECT is |
2184 // merely a dummy. The real test is that we don't trigger asserts in debug b uilds. | 2184 // merely a dummy. The real test is that we don't trigger asserts in debug b uilds. |
2185 EXPECT_FALSE(frameView->needsLayout()); | 2185 EXPECT_FALSE(frameView->needsLayout()); |
2186 }; | 2186 }; |
2187 | 2187 |
2188 } // namespace | 2188 } // namespace |
OLD | NEW |