OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 7797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7808 | 7808 |
7809 // Finally, make sure an embedder triggered load in the local frame swapped | 7809 // Finally, make sure an embedder triggered load in the local frame swapped |
7810 // back in works. | 7810 // back in works. |
7811 registerMockedHttpURLLoad("send_beacon.html"); | 7811 registerMockedHttpURLLoad("send_beacon.html"); |
7812 registerMockedHttpURLLoad("reload_post.html"); // url param to sendBeacon() | 7812 registerMockedHttpURLLoad("reload_post.html"); // url param to sendBeacon() |
7813 FrameTestHelpers::loadFrame(localFrame, m_baseURL + "send_beacon.html"); | 7813 FrameTestHelpers::loadFrame(localFrame, m_baseURL + "send_beacon.html"); |
7814 | 7814 |
7815 view->close(); | 7815 view->close(); |
7816 } | 7816 } |
7817 | 7817 |
| 7818 // See https://crbug.com/525285. |
| 7819 TEST_P(ParameterizedWebFrameTest, RemoteToLocalSwapOnMainFrameInitializesCoreFra
me) |
| 7820 { |
| 7821 FrameTestHelpers::TestWebViewClient viewClient; |
| 7822 FrameTestHelpers::TestWebRemoteFrameClient remoteClient; |
| 7823 WebView* view = WebView::create(&viewClient); |
| 7824 view->setMainFrame(remoteClient.frame()); |
| 7825 WebRemoteFrame* remoteRoot = view->mainFrame()->toWebRemoteFrame(); |
| 7826 remoteRoot->setReplicatedOrigin(SecurityOrigin::createUnique()); |
| 7827 |
| 7828 FrameTestHelpers::TestWebFrameClient localFrameClient; |
| 7829 remoteRoot->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags
::None, &localFrameClient, nullptr); |
| 7830 |
| 7831 // Do a remote-to-local swap of the top frame. |
| 7832 FrameTestHelpers::TestWebFrameClient localClient; |
| 7833 WebLocalFrame* localRoot = WebLocalFrame::create(WebTreeScopeType::Document,
&localClient); |
| 7834 localRoot->initializeToReplaceRemoteFrame(remoteRoot, "", WebSandboxFlags::N
one); |
| 7835 remoteRoot->swap(localRoot); |
| 7836 |
| 7837 // Load a page with a child frame in the new root to make sure this doesn't |
| 7838 // crash when the child frame invokes setCoreFrame. |
| 7839 FrameTestHelpers::loadFrame(localRoot, "data:text/html,<iframe></iframe>"); |
| 7840 |
| 7841 view->close(); |
| 7842 } |
| 7843 |
7818 class OverscrollWebViewClient : public FrameTestHelpers::TestWebViewClient { | 7844 class OverscrollWebViewClient : public FrameTestHelpers::TestWebViewClient { |
7819 public: | 7845 public: |
7820 MOCK_METHOD4(didOverscroll, void(const WebFloatSize&, const WebFloatSize&, c
onst WebFloatPoint&, const WebFloatSize&)); | 7846 MOCK_METHOD4(didOverscroll, void(const WebFloatSize&, const WebFloatSize&, c
onst WebFloatPoint&, const WebFloatSize&)); |
7821 }; | 7847 }; |
7822 | 7848 |
7823 class WebFrameOverscrollTest : public WebFrameTest { | 7849 class WebFrameOverscrollTest : public WebFrameTest { |
7824 protected: | 7850 protected: |
7825 WebGestureEvent generateEvent(WebInputEvent::Type type, float deltaX = 0.0,
float deltaY = 0.0) | 7851 WebGestureEvent generateEvent(WebInputEvent::Type type, float deltaX = 0.0,
float deltaY = 0.0) |
7826 { | 7852 { |
7827 WebGestureEvent event; | 7853 WebGestureEvent event; |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8092 | 8118 |
8093 TEST_F(WebFrameTest, MaxFramesDetach) | 8119 TEST_F(WebFrameTest, MaxFramesDetach) |
8094 { | 8120 { |
8095 registerMockedHttpURLLoad("max-frames-detach.html"); | 8121 registerMockedHttpURLLoad("max-frames-detach.html"); |
8096 FrameTestHelpers::WebViewHelper webViewHelper; | 8122 FrameTestHelpers::WebViewHelper webViewHelper; |
8097 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max-
frames-detach.html", true); | 8123 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max-
frames-detach.html", true); |
8098 webViewImpl->mainFrameImpl()->collectGarbage(); | 8124 webViewImpl->mainFrameImpl()->collectGarbage(); |
8099 } | 8125 } |
8100 | 8126 |
8101 } // namespace blink | 8127 } // namespace blink |
OLD | NEW |