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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 8932 matching lines...) Expand 10 before | Expand all | Expand 10 after
8943 lastChild(mainFrame())->swap(remoteFrame); 8943 lastChild(mainFrame())->swap(remoteFrame);
8944 remoteFrame->setReplicatedOrigin(SecurityOrigin::createUnique()); 8944 remoteFrame->setReplicatedOrigin(SecurityOrigin::createUnique());
8945 v8::Local<v8::Value> remoteWindowProperty = 8945 v8::Local<v8::Value> remoteWindowProperty =
8946 mainFrame()->executeScriptAndReturnValue( 8946 mainFrame()->executeScriptAndReturnValue(
8947 WebScriptSource("window[2].foo")); 8947 WebScriptSource("window[2].foo"));
8948 EXPECT_TRUE(remoteWindowProperty.IsEmpty()); 8948 EXPECT_TRUE(remoteWindowProperty.IsEmpty());
8949 8949
8950 reset(); 8950 reset();
8951 } 8951 }
8952 8952
8953 TEST_F(WebFrameSwapTest, RemoteWindowToString) {
8954 v8::HandleScope scope(v8::Isolate::GetCurrent());
8955
8956 FrameTestHelpers::TestWebRemoteFrameClient remoteClient;
8957 WebRemoteFrame* remoteFrame = remoteClient.frame();
8958 lastChild(mainFrame())->swap(remoteFrame);
8959 remoteFrame->setReplicatedOrigin(SecurityOrigin::createUnique());
8960 v8::Local<v8::Value> exception = mainFrame()->executeScriptAndReturnValue(
8961 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
8962 ASSERT_FALSE(exception.IsEmpty());
8963 EXPECT_STREQ(
8964 "SecurityError: Blocked a frame with origin \"http://internal.test\" "
8965 "from accessing a cross-origin frame.",
8966 *v8::String::Utf8Value(exception));
8967
8968 reset();
8969 }
8970
8953 // TODO(alexmos, dcheng): This test and some other OOPIF tests use 8971 // TODO(alexmos, dcheng): This test and some other OOPIF tests use
8954 // very little of the test fixture support in WebFrameSwapTest. We should 8972 // very little of the test fixture support in WebFrameSwapTest. We should
8955 // clean these tests up. 8973 // clean these tests up.
8956 TEST_F(WebFrameSwapTest, FramesOfRemoteParentAreIndexable) { 8974 TEST_F(WebFrameSwapTest, FramesOfRemoteParentAreIndexable) {
8957 v8::HandleScope scope(v8::Isolate::GetCurrent()); 8975 v8::HandleScope scope(v8::Isolate::GetCurrent());
8958 8976
8959 FrameTestHelpers::TestWebRemoteFrameClient remoteClient; 8977 FrameTestHelpers::TestWebRemoteFrameClient remoteClient;
8960 WebRemoteFrame* remoteParentFrame = remoteClient.frame(); 8978 WebRemoteFrame* remoteParentFrame = remoteClient.frame();
8961 mainFrame()->swap(remoteParentFrame); 8979 mainFrame()->swap(remoteParentFrame);
8962 remoteParentFrame->setReplicatedOrigin(SecurityOrigin::createUnique()); 8980 remoteParentFrame->setReplicatedOrigin(SecurityOrigin::createUnique());
(...skipping 2466 matching lines...) Expand 10 before | Expand all | Expand 10 after
11429 EXPECT_FALSE(testSelectAll("<textarea></textarea>")); 11447 EXPECT_FALSE(testSelectAll("<textarea></textarea>"));
11430 EXPECT_TRUE(testSelectAll("<textarea>nonempty</textarea>")); 11448 EXPECT_TRUE(testSelectAll("<textarea>nonempty</textarea>"));
11431 EXPECT_FALSE(testSelectAll("<input>")); 11449 EXPECT_FALSE(testSelectAll("<input>"));
11432 EXPECT_TRUE(testSelectAll("<input value='nonempty'>")); 11450 EXPECT_TRUE(testSelectAll("<input value='nonempty'>"));
11433 // TODO(amaralp): Empty contenteditable should not have select all enabled. 11451 // TODO(amaralp): Empty contenteditable should not have select all enabled.
11434 EXPECT_TRUE(testSelectAll("<div contenteditable></div>")); 11452 EXPECT_TRUE(testSelectAll("<div contenteditable></div>"));
11435 EXPECT_TRUE(testSelectAll("<div contenteditable>nonempty</div>")); 11453 EXPECT_TRUE(testSelectAll("<div contenteditable>nonempty</div>"));
11436 } 11454 }
11437 11455
11438 } // namespace blink 11456 } // namespace blink
OLDNEW
« 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