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

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

Issue 2796653003: Move ScriptState::forWorld/ScriptState::forMainWorld (Part 2) (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
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 m_otherScriptState = ScriptStateForTesting::create( 103 m_otherScriptState = ScriptStateForTesting::create(
104 v8::Context::New(isolate()), 104 v8::Context::New(isolate()),
105 DOMWrapperWorld::ensureIsolatedWorld(isolate(), 1)); 105 DOMWrapperWorld::ensureIsolatedWorld(isolate(), 1));
106 } 106 }
107 107
108 virtual ~ScriptPromisePropertyTestBase() { destroyContext(); } 108 virtual ~ScriptPromisePropertyTestBase() { destroyContext(); }
109 109
110 Document& document() { return m_page->document(); } 110 Document& document() { return m_page->document(); }
111 v8::Isolate* isolate() { return toIsolate(&document()); } 111 v8::Isolate* isolate() { return toIsolate(&document()); }
112 ScriptState* mainScriptState() { 112 ScriptState* mainScriptState() {
113 return ScriptState::forMainWorld(document().frame()); 113 return toScriptStateForMainWorld(document().frame());
114 } 114 }
115 DOMWrapperWorld& mainWorld() { return mainScriptState()->world(); } 115 DOMWrapperWorld& mainWorld() { return mainScriptState()->world(); }
116 ScriptState* otherScriptState() { return m_otherScriptState.get(); } 116 ScriptState* otherScriptState() { return m_otherScriptState.get(); }
117 DOMWrapperWorld& otherWorld() { return m_otherScriptState->world(); } 117 DOMWrapperWorld& otherWorld() { return m_otherScriptState->world(); }
118 ScriptState* currentScriptState() { return ScriptState::current(isolate()); } 118 ScriptState* currentScriptState() { return ScriptState::current(isolate()); }
119 119
120 void destroyContext() { 120 void destroyContext() {
121 m_page.reset(); 121 m_page.reset();
122 if (m_otherScriptState) { 122 if (m_otherScriptState) {
123 m_otherScriptState->disposePerContextData(); 123 m_otherScriptState->disposePerContextData();
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 ResolveWithString) { 479 ResolveWithString) {
480 test(String("hello"), "hello", __FILE__, __LINE__); 480 test(String("hello"), "hello", __FILE__, __LINE__);
481 } 481 }
482 482
483 TEST_F(ScriptPromisePropertyNonScriptWrappableResolutionTargetTest, 483 TEST_F(ScriptPromisePropertyNonScriptWrappableResolutionTargetTest,
484 ResolveWithInteger) { 484 ResolveWithInteger) {
485 test(-1, "-1", __FILE__, __LINE__); 485 test(-1, "-1", __FILE__, __LINE__);
486 } 486 }
487 487
488 } // namespace blink 488 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698