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

Unified Diff: Source/web/tests/WebViewTest.cpp

Issue 1158973004: If javascript: returns no result, balance load progress notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix component building Created 5 years, 4 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 | « Source/bindings/core/v8/ScriptController.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/bindings/core/v8/ScriptController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698