| OLD | NEW |
| 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/ScriptPromiseProperty.h" | 5 #include "bindings/core/v8/ScriptPromiseProperty.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/DOMWrapperWorld.h" | 7 #include "bindings/core/v8/DOMWrapperWorld.h" |
| 8 #include "bindings/core/v8/ScriptFunction.h" | 8 #include "bindings/core/v8/ScriptFunction.h" |
| 9 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
| 10 #include "bindings/core/v8/ScriptState.h" | 10 #include "bindings/core/v8/ScriptState.h" |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 TEST_F(ScriptPromisePropertyGarbageCollectedTest, Resolve_DeadContext) { | 368 TEST_F(ScriptPromisePropertyGarbageCollectedTest, Resolve_DeadContext) { |
| 369 { | 369 { |
| 370 ScriptState::Scope scope(mainScriptState()); | 370 ScriptState::Scope scope(mainScriptState()); |
| 371 getProperty() | 371 getProperty() |
| 372 ->promise(DOMWrapperWorld::mainWorld()) | 372 ->promise(DOMWrapperWorld::mainWorld()) |
| 373 .then(notReached(currentScriptState()), | 373 .then(notReached(currentScriptState()), |
| 374 notReached(currentScriptState())); | 374 notReached(currentScriptState())); |
| 375 } | 375 } |
| 376 | 376 |
| 377 destroyContext(); | 377 destroyContext(); |
| 378 EXPECT_TRUE( | 378 EXPECT_TRUE(!getProperty()->getExecutionContext() || |
| 379 !getProperty()->getExecutionContext() || | 379 getProperty()->getExecutionContext()->isContextDestroyed()); |
| 380 getProperty()->getExecutionContext()->activeDOMObjectsAreStopped()); | |
| 381 | 380 |
| 382 getProperty()->resolve(new GarbageCollectedScriptWrappable("value")); | 381 getProperty()->resolve(new GarbageCollectedScriptWrappable("value")); |
| 383 EXPECT_EQ(Property::Pending, getProperty()->getState()); | 382 EXPECT_EQ(Property::Pending, getProperty()->getState()); |
| 384 | 383 |
| 385 v8::MicrotasksScope::PerformCheckpoint(v8::Isolate::GetCurrent()); | 384 v8::MicrotasksScope::PerformCheckpoint(v8::Isolate::GetCurrent()); |
| 386 } | 385 } |
| 387 | 386 |
| 388 TEST_F(ScriptPromisePropertyGarbageCollectedTest, Reset) { | 387 TEST_F(ScriptPromisePropertyGarbageCollectedTest, Reset) { |
| 389 ScriptPromise oldPromise, newPromise; | 388 ScriptPromise oldPromise, newPromise; |
| 390 ScriptValue oldActual, newActual; | 389 ScriptValue oldActual, newActual; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 ResolveWithString) { | 476 ResolveWithString) { |
| 478 test(String("hello"), "hello", __FILE__, __LINE__); | 477 test(String("hello"), "hello", __FILE__, __LINE__); |
| 479 } | 478 } |
| 480 | 479 |
| 481 TEST_F(ScriptPromisePropertyNonScriptWrappableResolutionTargetTest, | 480 TEST_F(ScriptPromisePropertyNonScriptWrappableResolutionTargetTest, |
| 482 ResolveWithInteger) { | 481 ResolveWithInteger) { |
| 483 test(-1, "-1", __FILE__, __LINE__); | 482 test(-1, "-1", __FILE__, __LINE__); |
| 484 } | 483 } |
| 485 | 484 |
| 486 } // namespace | 485 } // namespace |
| OLD | NEW |