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

Unified Diff: Source/web/tests/WebFrameTest.cpp

Issue 1311433008: Migrate PingLoader to be a LocalFrameLifecycleObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix style. Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/loader/PingLoader.cpp ('k') | Source/web/tests/data/send_beacon.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/WebFrameTest.cpp
diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp
index a2261fc7dd95e4811121d378c6d09d5f940b2aeb..d26965fd60e5c94fd4a20ccb4444e7fbe76458f1 100644
--- a/Source/web/tests/WebFrameTest.cpp
+++ b/Source/web/tests/WebFrameTest.cpp
@@ -7793,6 +7793,28 @@ TEST_P(ParameterizedWebFrameTest, CreateLocalChildWithPreviousSibling)
view->close();
}
+TEST_P(ParameterizedWebFrameTest, SendBeaconFromChildWithRemoteMainFrame)
+{
+ FrameTestHelpers::TestWebViewClient viewClient;
+ FrameTestHelpers::TestWebRemoteFrameClient remoteClient;
+ WebView* view = WebView::create(&viewClient);
+ view->settings()->setJavaScriptEnabled(true);
+ view->setMainFrame(remoteClient.frame());
+ WebRemoteFrame* root = view->mainFrame()->toWebRemoteFrame();
+ root->setReplicatedOrigin(SecurityOrigin::createUnique());
+
+ FrameTestHelpers::TestWebFrameClient localFrameClient;
+ WebLocalFrame* localFrame = root->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, &localFrameClient, nullptr);
+
+ // Finally, make sure an embedder triggered load in the local frame swapped
+ // back in works.
+ registerMockedHttpURLLoad("send_beacon.html");
+ registerMockedHttpURLLoad("reload_post.html"); // url param to sendBeacon()
+ FrameTestHelpers::loadFrame(localFrame, m_baseURL + "send_beacon.html");
+
+ view->close();
+}
+
class OverscrollWebViewClient : public FrameTestHelpers::TestWebViewClient {
public:
MOCK_METHOD4(didOverscroll, void(const WebFloatSize&, const WebFloatSize&, const WebFloatPoint&, const WebFloatSize&));
« no previous file with comments | « Source/core/loader/PingLoader.cpp ('k') | Source/web/tests/data/send_beacon.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698