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

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

Issue 2760793002: Use v8::Context::NewRemoteContext in RemoteWindowProxy. (Closed)
Patch Set: Clean up association logic Created 3 years, 9 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 | « third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698