Index: Source/web/tests/WebViewTest.cpp |
diff --git a/Source/web/tests/WebViewTest.cpp b/Source/web/tests/WebViewTest.cpp |
index ea64a12c23f7a46f91be07b99d073bc78023291c..c9a7dca52741c8b0c94142c2581887a5798f78db 100644 |
--- a/Source/web/tests/WebViewTest.cpp |
+++ b/Source/web/tests/WebViewTest.cpp |
@@ -31,6 +31,7 @@ |
#include "config.h" |
#include "public/web/WebView.h" |
+#include "bindings/core/v8/V8Document.h" |
#include "core/dom/Document.h" |
#include "core/dom/Element.h" |
#include "core/editing/FrameSelection.h" |
@@ -3051,4 +3052,21 @@ TEST_F(WebViewTest, TestRecordFrameTimingEvents) |
} |
} |
+ |
+TEST_F(WebViewTest, StopLoadingIfJavaScriptURLReturnsNoStringResult) |
+{ |
+ ViewCreatingWebViewClient client; |
+ FrameTestHelpers::WebViewHelper mainWebView; |
+ mainWebView.initializeAndLoad("about:blank", true, 0, &client); |
+ mainWebView.webViewImpl()->page()->settings().setJavaScriptCanOpenWindowsAutomatically(true); |
+ |
+ WebFrame* frame = mainWebView.webView()->mainFrame(); |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
+ v8::Local<v8::Value> v8Value = frame->executeScriptAndReturnValue(WebScriptSource("var win = window.open('javascript:false'); win.document")); |
+ ASSERT_TRUE(v8Value->IsObject()); |
+ Document* document = V8Document::toImplWithTypeCheck(v8::Isolate::GetCurrent(), v8Value); |
+ ASSERT_TRUE(document); |
+ EXPECT_FALSE(document->frame()->isLoading()); |
+} |
+ |
} // namespace blink |