Chromium Code Reviews| Index: third_party/WebKit/Source/web/tests/WebFrameTest.cpp |
| diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp |
| index dcaacbcf8c23311905e408621585bb18e1b8140e..e6d91419d044bdca664f61b6ea96707661bc64f7 100644 |
| --- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp |
| +++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp |
| @@ -8950,6 +8950,24 @@ TEST_F(WebFrameSwapTest, RemoteWindowNamedAccess) { |
| reset(); |
| } |
| +TEST_F(WebFrameSwapTest, RemoteWindowToString) { |
| + v8::HandleScope scope(v8::Isolate::GetCurrent()); |
| + |
| + FrameTestHelpers::TestWebRemoteFrameClient remoteClient; |
| + WebRemoteFrame* remoteFrame = remoteClient.frame(); |
| + lastChild(mainFrame())->swap(remoteFrame); |
| + remoteFrame->setReplicatedOrigin(SecurityOrigin::createUnique()); |
| + v8::Local<v8::Value> exception = mainFrame()->executeScriptAndReturnValue( |
| + WebScriptSource("try { '' + window[2]; } catch (e) { e; }")); |
|
jochen (gone - plz use gerrit)
2017/03/23 18:27:48
Object.prototype.toString.call(window[2]) should w
dcheng
2017/03/23 18:31:51
Hmm... that's one version I forgot to try. I'll up
|
| + ASSERT_FALSE(exception.IsEmpty()); |
| + EXPECT_STREQ( |
| + "SecurityError: Blocked a frame with origin \"http://internal.test\" " |
| + "from accessing a cross-origin frame.", |
| + *v8::String::Utf8Value(exception)); |
| + |
| + reset(); |
| +} |
| + |
| // TODO(alexmos, dcheng): This test and some other OOPIF tests use |
| // very little of the test fixture support in WebFrameSwapTest. We should |
| // clean these tests up. |