Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Side by Side Diff: Source/web/tests/WebViewTest.cpp

Issue 454643002: Route selection bounds updates through WebLayerTreeView (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: revised Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 "-webkit-text-stroke-width: 0px;\">Price 10,000,000won</div>"; 1642 "-webkit-text-stroke-width: 0px;\">Price 10,000,000won</div>";
1643 WebString clipText; 1643 WebString clipText;
1644 WebString clipHtml; 1644 WebString clipHtml;
1645 WebRect clipRect; 1645 WebRect clipRect;
1646 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("Ahem.ttf")); 1646 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("Ahem.ttf"));
1647 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("smartclip.html")); 1647 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("smartclip.html"));
1648 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "smartclip. html"); 1648 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "smartclip. html");
1649 webView->setPageScaleFactorLimits(1, 1); 1649 webView->setPageScaleFactorLimits(1, 1);
1650 webView->resize(WebSize(500, 500)); 1650 webView->resize(WebSize(500, 500));
1651 webView->layout(); 1651 webView->layout();
1652 WebRect cropRect(300, 125, 100, 50); 1652 WebRect cropRect(300, 125, 152, 50);
1653 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect); 1653 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect);
1654 EXPECT_STREQ(kExpectedClipText, clipText.utf8().c_str()); 1654 EXPECT_STREQ(kExpectedClipText, clipText.utf8().c_str());
1655 EXPECT_STREQ(kExpectedClipHtml, clipHtml.utf8().c_str()); 1655 EXPECT_STREQ(kExpectedClipHtml, clipHtml.utf8().c_str());
1656 } 1656 }
1657 1657
1658 TEST_F(WebViewTest, SmartClipReturnsEmptyStringsWhenUserSelectIsNone) 1658 TEST_F(WebViewTest, SmartClipReturnsEmptyStringsWhenUserSelectIsNone)
1659 { 1659 {
1660 WebString clipText; 1660 WebString clipText;
1661 WebString clipHtml; 1661 WebString clipHtml;
1662 WebRect clipRect; 1662 WebRect clipRect;
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
2213 loadFrame(webView->mainFrame(), url); 2213 loadFrame(webView->mainFrame(), url);
2214 2214
2215 FrameView* frameView = m_webViewHelper.webViewImpl()->mainFrameImpl()->frame View(); 2215 FrameView* frameView = m_webViewHelper.webViewImpl()->mainFrameImpl()->frame View();
2216 2216
2217 // Auto-resizing used to ASSERT(needsLayout()) in RenderBlockFlow::layout. T his EXPECT is 2217 // Auto-resizing used to ASSERT(needsLayout()) in RenderBlockFlow::layout. T his EXPECT is
2218 // merely a dummy. The real test is that we don't trigger asserts in debug b uilds. 2218 // merely a dummy. The real test is that we don't trigger asserts in debug b uilds.
2219 EXPECT_FALSE(frameView->needsLayout()); 2219 EXPECT_FALSE(frameView->needsLayout());
2220 }; 2220 };
2221 2221
2222 } // namespace 2222 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698