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

Side by Side Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp

Issue 1743763004: Use v8::MicrotasksScope internally in V8RecursionScope. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v8rs-2-endofscope
Patch Set: v8_helpers Created 4 years, 9 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 | « third_party/WebKit/Source/modules/fetch/ReadableStreamDataConsumerHandleTest.cpp ('k') | 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 1
2 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Copyright 2014 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 5
6 #include "modules/serviceworkers/ServiceWorkerContainer.h" 6 #include "modules/serviceworkers/ServiceWorkerContainer.h"
7 7
8 #include "bindings/core/v8/Dictionary.h" 8 #include "bindings/core/v8/Dictionary.h"
9 #include "bindings/core/v8/ScriptFunction.h" 9 #include "bindings/core/v8/ScriptFunction.h"
10 #include "bindings/core/v8/ScriptPromise.h" 10 #include "bindings/core/v8/ScriptPromise.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 virtual ~ScriptValueTest() { } 85 virtual ~ScriptValueTest() { }
86 virtual void operator()(ScriptValue) const = 0; 86 virtual void operator()(ScriptValue) const = 0;
87 }; 87 };
88 88
89 // Runs microtasks and expects |promise| to be rejected. Calls 89 // Runs microtasks and expects |promise| to be rejected. Calls
90 // |valueTest| with the value passed to |reject|, if any. 90 // |valueTest| with the value passed to |reject|, if any.
91 void expectRejected(ScriptState* scriptState, ScriptPromise& promise, const Scri ptValueTest& valueTest) 91 void expectRejected(ScriptState* scriptState, ScriptPromise& promise, const Scri ptValueTest& valueTest)
92 { 92 {
93 StubScriptFunction resolved, rejected; 93 StubScriptFunction resolved, rejected;
94 promise.then(resolved.function(scriptState), rejected.function(scriptState)) ; 94 promise.then(resolved.function(scriptState), rejected.function(scriptState)) ;
95 promise.isolate()->RunMicrotasks(); 95 v8::MicrotasksScope::PerformCheckpoint(promise.isolate());
96 EXPECT_EQ(0ul, resolved.callCount()); 96 EXPECT_EQ(0ul, resolved.callCount());
97 EXPECT_EQ(1ul, rejected.callCount()); 97 EXPECT_EQ(1ul, rejected.callCount());
98 if (rejected.callCount()) 98 if (rejected.callCount())
99 valueTest(rejected.arg()); 99 valueTest(rejected.arg());
100 } 100 }
101 101
102 // DOM-related test support. 102 // DOM-related test support.
103 103
104 // Matches a ScriptValue and a DOMException with a specific name and message. 104 // Matches a ScriptValue and a DOMException with a specific name and message.
105 class ExpectDOMException : public ScriptValueTest { 105 class ExpectDOMException : public ScriptValueTest {
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 container->getRegistration(getScriptState(), ""); 356 container->getRegistration(getScriptState(), "");
357 EXPECT_EQ(1ul, stubProvider.getRegistrationCallCount()); 357 EXPECT_EQ(1ul, stubProvider.getRegistrationCallCount());
358 EXPECT_EQ(WebURL(KURL(KURL(), "http://localhost/x/index.html")), stubPro vider.getRegistrationURL()); 358 EXPECT_EQ(WebURL(KURL(KURL(), "http://localhost/x/index.html")), stubPro vider.getRegistrationURL());
359 } 359 }
360 360
361 container->willBeDetachedFromFrame(); 361 container->willBeDetachedFromFrame();
362 } 362 }
363 363
364 } // namespace 364 } // namespace
365 } // namespace blink 365 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/ReadableStreamDataConsumerHandleTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698