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 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1681 webView->layout(); | 1681 webView->layout(); |
1682 WebRect cropRect(0, 0, 100, 100); | 1682 WebRect cropRect(0, 0, 100, 100); |
1683 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect); | 1683 webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect); |
1684 EXPECT_STREQ("", clipText.utf8().c_str()); | 1684 EXPECT_STREQ("", clipText.utf8().c_str()); |
1685 EXPECT_STREQ("", clipHtml.utf8().c_str()); | 1685 EXPECT_STREQ("", clipHtml.utf8().c_str()); |
1686 } | 1686 } |
1687 | 1687 |
1688 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien
t { | 1688 class CreateChildCounterFrameClient : public FrameTestHelpers::TestWebFrameClien
t { |
1689 public: | 1689 public: |
1690 CreateChildCounterFrameClient() : m_count(0) { } | 1690 CreateChildCounterFrameClient() : m_count(0) { } |
1691 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString& f
rameName) override; | 1691 virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString& f
rameName, WebSandboxFlags) override; |
1692 | 1692 |
1693 int count() const { return m_count; } | 1693 int count() const { return m_count; } |
1694 | 1694 |
1695 private: | 1695 private: |
1696 int m_count; | 1696 int m_count; |
1697 }; | 1697 }; |
1698 | 1698 |
1699 WebFrame* CreateChildCounterFrameClient::createChildFrame(WebLocalFrame* parent,
const WebString& frameName) | 1699 WebFrame* CreateChildCounterFrameClient::createChildFrame(WebLocalFrame* parent,
const WebString& frameName, WebSandboxFlags sandboxFlags) |
1700 { | 1700 { |
1701 ++m_count; | 1701 ++m_count; |
1702 return TestWebFrameClient::createChildFrame(parent, frameName); | 1702 return TestWebFrameClient::createChildFrame(parent, frameName, sandboxFlags)
; |
1703 } | 1703 } |
1704 | 1704 |
1705 TEST_F(WebViewTest, AddFrameInCloseUnload) | 1705 TEST_F(WebViewTest, AddFrameInCloseUnload) |
1706 { | 1706 { |
1707 CreateChildCounterFrameClient frameClient; | 1707 CreateChildCounterFrameClient frameClient; |
1708 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("add_frame_in_unload.html")); | 1708 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("add_frame_in_unload.html")); |
1709 m_webViewHelper.initializeAndLoad(m_baseURL + "add_frame_in_unload.html", tr
ue, &frameClient); | 1709 m_webViewHelper.initializeAndLoad(m_baseURL + "add_frame_in_unload.html", tr
ue, &frameClient); |
1710 m_webViewHelper.reset(); | 1710 m_webViewHelper.reset(); |
1711 EXPECT_EQ(0, frameClient.count()); | 1711 EXPECT_EQ(0, frameClient.count()); |
1712 } | 1712 } |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2172 EXPECT_EQ(100, size.width); | 2172 EXPECT_EQ(100, size.width); |
2173 EXPECT_EQ(100, size.height); | 2173 EXPECT_EQ(100, size.height); |
2174 | 2174 |
2175 webView->setZoomLevel(WebView::zoomFactorToZoomLevel(2.0)); | 2175 webView->setZoomLevel(WebView::zoomFactorToZoomLevel(2.0)); |
2176 size = webView->contentsPreferredMinimumSize(); | 2176 size = webView->contentsPreferredMinimumSize(); |
2177 EXPECT_EQ(200, size.width); | 2177 EXPECT_EQ(200, size.width); |
2178 EXPECT_EQ(200, size.height); | 2178 EXPECT_EQ(200, size.height); |
2179 } | 2179 } |
2180 | 2180 |
2181 } // namespace | 2181 } // namespace |
OLD | NEW |