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 |