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

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

Issue 2371993003: Throw when blocking top-level navigation. (Closed)
Patch Set: Test. Created 4 years, 3 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
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 b194b12acc238adb096946b664ad9b1ea0dbd8bc..272b7410c8df7ff72317c525bb7ec182292adcba 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -7939,7 +7939,7 @@ TEST_P(ParameterizedWebFrameTest, CrossDomainAccessErrorsUseCallingWindow)
// Attempt a blocked navigation of an opener's subframe, and ensure that
// the error shows up on the popup (calling) window's console, rather than
// the target window.
- popupView->mainFrame()->executeScript(WebScriptSource("opener.frames[1].location.href='data:text/html,foo'"));
+ popupView->mainFrame()->executeScript(WebScriptSource("try { opener.frames[1].location.href='data:text/html,foo'; } catch (e) {}"));
EXPECT_TRUE(webFrameClient.messages.isEmpty());
ASSERT_EQ(1u, popupWebFrameClient.messages.size());
EXPECT_TRUE(std::string::npos != popupWebFrameClient.messages[0].text.utf8().find("Unsafe JavaScript attempt to initiate navigation"));

Powered by Google App Engine
This is Rietveld 408576698