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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "bindings/core/v8/ScriptStreamer.h" 5 #include "bindings/core/v8/ScriptStreamer.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "bindings/core/v8/ScriptSourceCode.h" 9 #include "bindings/core/v8/ScriptSourceCode.h"
10 #include "bindings/core/v8/ScriptStreamerThread.h" 10 #include "bindings/core/v8/ScriptStreamerThread.h"
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 EXPECT_TRUE(source_code.Streamer()); 410 EXPECT_TRUE(source_code.Streamer());
411 v8::TryCatch try_catch(scope.GetIsolate()); 411 v8::TryCatch try_catch(scope.GetIsolate());
412 v8::Local<v8::Script> script; 412 v8::Local<v8::Script> script;
413 EXPECT_TRUE(V8ScriptRunner::CompileScript(source_code, scope.GetIsolate(), 413 EXPECT_TRUE(V8ScriptRunner::CompileScript(source_code, scope.GetIsolate(),
414 kSharableCrossOrigin, 414 kSharableCrossOrigin,
415 kV8CacheOptionsDefault) 415 kV8CacheOptionsDefault)
416 .ToLocal(&script)); 416 .ToLocal(&script));
417 EXPECT_FALSE(try_catch.HasCaught()); 417 EXPECT_FALSE(try_catch.HasCaught());
418 } 418 }
419 419
420 // A test for crbug.com/711703. Should not crash.
421 TEST_F(ScriptStreamingTest, GarbageCollectDuringStreaming) {
422 V8TestingScope scope;
423 ScriptStreamer::StartStreaming(
424 GetPendingScript(), ScriptStreamer::kParsingBlocking, settings_.get(),
425 scope.GetScriptState(), loading_task_runner_);
426
427 TestPendingScriptClient* client = new TestPendingScriptClient;
428 GetPendingScript()->WatchForLoad(client);
429 EXPECT_FALSE(client->Finished());
430
431 pending_script_ = nullptr;
432 ThreadState::Current()->CollectGarbage(BlinkGC::kNoHeapPointersOnStack,
433 BlinkGC::kGCWithSweep,
434 BlinkGC::kForcedGC);
435 }
436
420 } // namespace 437 } // namespace
421 438
422 } // namespace blink 439 } // namespace blink
OLDNEW
« 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