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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp

Issue 2828973002: Add a unit test for Issue 711703 (Closed)
Patch Set: Rebase Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp
index 92eb40e9fc613bb622db1e427964fae4b6ec6178..81e77fe8cd6a91c405d27ecf57072b1424940ed9 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp
@@ -417,6 +417,23 @@ TEST_F(ScriptStreamingTest, EncodingFromBOM) {
EXPECT_FALSE(try_catch.HasCaught());
}
+// A test for crbug.com/711703. Should not crash.
+TEST_F(ScriptStreamingTest, GarbageCollectDuringStreaming) {
+ V8TestingScope scope;
+ ScriptStreamer::StartStreaming(
+ GetPendingScript(), ScriptStreamer::kParsingBlocking, settings_.get(),
+ scope.GetScriptState(), loading_task_runner_);
+
+ TestPendingScriptClient* client = new TestPendingScriptClient;
+ GetPendingScript()->WatchForLoad(client);
+ EXPECT_FALSE(client->Finished());
+
+ pending_script_ = nullptr;
+ ThreadState::Current()->CollectGarbage(BlinkGC::kNoHeapPointersOnStack,
+ BlinkGC::kGCWithSweep,
+ BlinkGC::kForcedGC);
+}
+
} // namespace
} // namespace blink
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698