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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyTest.cpp

Issue 2774233007: [Bindings] Move ScriptPromiseProperties from V8HiddenValue to V8PrivateProperty (Closed)
Patch Set: workaround 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
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/ScriptPromiseProperty.h" 5 #include "bindings/core/v8/ScriptPromiseProperty.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "bindings/core/v8/DOMWrapperWorld.h" 9 #include "bindings/core/v8/DOMWrapperWorld.h"
10 #include "bindings/core/v8/ScriptFunction.h" 10 #include "bindings/core/v8/ScriptFunction.h"
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 EXPECT_TRUE(!getProperty()->getExecutionContext() || 424 EXPECT_TRUE(!getProperty()->getExecutionContext() ||
425 getProperty()->getExecutionContext()->isContextDestroyed()); 425 getProperty()->getExecutionContext()->isContextDestroyed());
426 426
427 getProperty()->resolve(new GarbageCollectedScriptWrappable("value")); 427 getProperty()->resolve(new GarbageCollectedScriptWrappable("value"));
428 EXPECT_EQ(Property::Pending, getProperty()->getState()); 428 EXPECT_EQ(Property::Pending, getProperty()->getState());
429 429
430 v8::MicrotasksScope::PerformCheckpoint(v8::Isolate::GetCurrent()); 430 v8::MicrotasksScope::PerformCheckpoint(v8::Isolate::GetCurrent());
431 } 431 }
432 432
433 TEST_F(ScriptPromisePropertyGarbageCollectedTest, Reset) { 433 TEST_F(ScriptPromisePropertyGarbageCollectedTest, Reset) {
434 ScriptState::Scope scope(mainScriptState());
435
434 ScriptPromise oldPromise, newPromise; 436 ScriptPromise oldPromise, newPromise;
435 ScriptValue oldActual, newActual; 437 ScriptValue oldActual, newActual;
436 GarbageCollectedScriptWrappable* oldValue = 438 GarbageCollectedScriptWrappable* oldValue =
437 new GarbageCollectedScriptWrappable("old"); 439 new GarbageCollectedScriptWrappable("old");
438 GarbageCollectedScriptWrappable* newValue = 440 GarbageCollectedScriptWrappable* newValue =
439 new GarbageCollectedScriptWrappable("new"); 441 new GarbageCollectedScriptWrappable("new");
440 size_t nOldResolveCalls = 0; 442 size_t nOldResolveCalls = 0;
441 size_t nNewRejectCalls = 0; 443 size_t nNewRejectCalls = 0;
442 444
443 { 445 {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 ResolveWithString) { 481 ResolveWithString) {
480 test(String("hello"), "hello", __FILE__, __LINE__); 482 test(String("hello"), "hello", __FILE__, __LINE__);
481 } 483 }
482 484
483 TEST_F(ScriptPromisePropertyNonScriptWrappableResolutionTargetTest, 485 TEST_F(ScriptPromisePropertyNonScriptWrappableResolutionTargetTest,
484 ResolveWithInteger) { 486 ResolveWithInteger) {
485 test(-1, "-1", __FILE__, __LINE__); 487 test(-1, "-1", __FILE__, __LINE__);
486 } 488 }
487 489
488 } // namespace blink 490 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698