| Index: Source/web/tests/WebFrameTest.cpp
|
| diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp
|
| index e27f7916465b44dc9693d0a9d835397a43593146..d303c2aa1226396621fb7f3999da81aea0c35aeb 100644
|
| --- a/Source/web/tests/WebFrameTest.cpp
|
| +++ b/Source/web/tests/WebFrameTest.cpp
|
| @@ -6580,7 +6580,7 @@
|
| FrameTestHelpers::TestWebViewClient viewClient;
|
| FrameTestHelpers::TestWebRemoteFrameClient remoteClient;
|
| WebView* view = WebView::create(&viewClient);
|
| - view->setMainFrame(remoteClient.frame());
|
| + view->setMainFrame(WebRemoteFrame::create(&remoteClient));
|
| FrameTestHelpers::TestWebFrameClient childFrameClient;
|
| WebLocalFrame* childFrame = view->mainFrame()->toWebRemoteFrame()->createLocalChild("", WebSandboxFlags::None, &childFrameClient);
|
|
|
| @@ -6794,8 +6794,7 @@
|
| ASSERT_TRUE(originalWindow->IsObject());
|
|
|
| // Make sure window reference stays the same when swapping to a remote frame.
|
| - FrameTestHelpers::TestWebRemoteFrameClient remoteClient;
|
| - WebRemoteFrame* remoteFrame = remoteClient.frame();
|
| + WebRemoteFrame* remoteFrame = WebRemoteFrame::create(nullptr);
|
| WebFrame* targetFrame = mainFrame()->firstChild()->nextSibling();
|
| targetFrame->swap(remoteFrame);
|
| // FIXME: This cleanup should be unnecessary, but the interaction between frame detach
|
| @@ -6842,8 +6841,7 @@
|
| {
|
| v8::HandleScope scope(v8::Isolate::GetCurrent());
|
|
|
| - FrameTestHelpers::TestWebRemoteFrameClient remoteClient;
|
| - WebRemoteFrame* remoteFrame = remoteClient.frame();
|
| + WebRemoteFrame* remoteFrame = WebRemoteFrame::create(nullptr);
|
| mainFrame()->lastChild()->swap(remoteFrame);
|
| remoteFrame->setReplicatedOrigin(SecurityOrigin::createUnique());
|
| v8::Local<v8::Value> remoteWindow = mainFrame()->executeScriptAndReturnValue(WebScriptSource("window[2]"));
|
| @@ -6852,24 +6850,19 @@
|
| ASSERT_TRUE(windowLength->IsNumber());
|
| v8::Local<v8::Integer> windowLengthInteger = windowLength->ToInteger();
|
| EXPECT_EQ(3, windowLengthInteger->Value());
|
| -
|
| - reset();
|
| }
|
|
|
| TEST_F(WebFrameSwapTest, RemoteFrameLengthAccess)
|
| {
|
| v8::HandleScope scope(v8::Isolate::GetCurrent());
|
|
|
| - FrameTestHelpers::TestWebRemoteFrameClient remoteClient;
|
| - WebRemoteFrame* remoteFrame = remoteClient.frame();
|
| + WebRemoteFrame* remoteFrame = WebRemoteFrame::create(nullptr);
|
| mainFrame()->lastChild()->swap(remoteFrame);
|
| remoteFrame->setReplicatedOrigin(SecurityOrigin::createUnique());
|
| v8::Local<v8::Value> remoteWindowLength = mainFrame()->executeScriptAndReturnValue(WebScriptSource("window[2].length"));
|
| ASSERT_TRUE(remoteWindowLength->IsNumber());
|
| v8::Local<v8::Integer> remoteWindowLengthInteger = remoteWindowLength->ToInteger();
|
| EXPECT_EQ(0, remoteWindowLengthInteger->Value());
|
| -
|
| - reset();
|
| }
|
|
|
| TEST_F(WebFrameSwapTest, RemoteWindowNamedAccess)
|
| @@ -6879,14 +6872,11 @@
|
| // FIXME: Once OOPIF unit test infrastructure is in place, test that named
|
| // window access on a remote window works. For now, just test that accessing
|
| // a named property doesn't crash.
|
| - FrameTestHelpers::TestWebRemoteFrameClient remoteClient;
|
| - WebRemoteFrame* remoteFrame = remoteClient.frame();
|
| + WebRemoteFrame* remoteFrame = WebRemoteFrame::create(nullptr);
|
| mainFrame()->lastChild()->swap(remoteFrame);
|
| remoteFrame->setReplicatedOrigin(SecurityOrigin::createUnique());
|
| v8::Local<v8::Value> remoteWindowProperty = mainFrame()->executeScriptAndReturnValue(WebScriptSource("window[2].foo"));
|
| EXPECT_TRUE(remoteWindowProperty.IsEmpty());
|
| -
|
| - reset();
|
| }
|
|
|
| class RemoteToLocalSwapWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
|
| @@ -6946,7 +6936,7 @@
|
| TEST_F(WebFrameSwapTest, NavigateRemoteFrameViaLocation)
|
| {
|
| RemoteNavigationClient client;
|
| - WebRemoteFrame* remoteFrame = client.frame();
|
| + WebRemoteFrame* remoteFrame = WebRemoteFrame::create(&client);
|
| WebFrame* targetFrame = mainFrame()->firstChild();
|
| ASSERT_TRUE(targetFrame);
|
| targetFrame->swap(remoteFrame);
|
| @@ -6962,6 +6952,7 @@
|
| // Manually reset to break WebViewHelper's dependency on the stack allocated
|
| // TestWebFrameClient.
|
| reset();
|
| + remoteFrame->close();
|
| }
|
|
|
| class MockDocumentThreadableLoaderClient : public DocumentThreadableLoaderClient {
|
| @@ -7079,7 +7070,7 @@
|
| FrameTestHelpers::TestWebViewClient viewClient;
|
| FrameTestHelpers::TestWebRemoteFrameClient remoteClient;
|
| WebView* view = WebView::create(&viewClient);
|
| - view->setMainFrame(remoteClient.frame());
|
| + view->setMainFrame(WebRemoteFrame::create(&remoteClient));
|
| FrameTestHelpers::TestWebRemoteFrameClient childFrameClient;
|
| WebRemoteFrame* childFrame = view->mainFrame()->toWebRemoteFrame()->createRemoteChild("", WebSandboxFlags::None, &childFrameClient);
|
| childFrame->detach();
|
|
|