| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 Member<Property> m_property; | 94 Member<Property> m_property; |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 class ScriptPromisePropertyTestBase { | 97 class ScriptPromisePropertyTestBase { |
| 98 public: | 98 public: |
| 99 ScriptPromisePropertyTestBase() | 99 ScriptPromisePropertyTestBase() |
| 100 : m_page(DummyPageHolder::create(IntSize(1, 1))) { | 100 : m_page(DummyPageHolder::create(IntSize(1, 1))) { |
| 101 v8::HandleScope handleScope(isolate()); | 101 v8::HandleScope handleScope(isolate()); |
| 102 m_otherScriptState = ScriptStateForTesting::create( | 102 m_otherScriptState = ScriptStateForTesting::create( |
| 103 v8::Context::New(isolate()), | 103 v8::Context::New(isolate()), |
| 104 DOMWrapperWorld::ensureIsolatedWorld(isolate(), 1, -1)); | 104 DOMWrapperWorld::ensureIsolatedWorld(isolate(), 1)); |
| 105 } | 105 } |
| 106 | 106 |
| 107 virtual ~ScriptPromisePropertyTestBase() { destroyContext(); } | 107 virtual ~ScriptPromisePropertyTestBase() { destroyContext(); } |
| 108 | 108 |
| 109 Document& document() { return m_page->document(); } | 109 Document& document() { return m_page->document(); } |
| 110 v8::Isolate* isolate() { return toIsolate(&document()); } | 110 v8::Isolate* isolate() { return toIsolate(&document()); } |
| 111 ScriptState* mainScriptState() { | 111 ScriptState* mainScriptState() { |
| 112 return ScriptState::forMainWorld(document().frame()); | 112 return ScriptState::forMainWorld(document().frame()); |
| 113 } | 113 } |
| 114 DOMWrapperWorld& mainWorld() { return mainScriptState()->world(); } | 114 DOMWrapperWorld& mainWorld() { return mainScriptState()->world(); } |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 ResolveWithString) { | 476 ResolveWithString) { |
| 477 test(String("hello"), "hello", __FILE__, __LINE__); | 477 test(String("hello"), "hello", __FILE__, __LINE__); |
| 478 } | 478 } |
| 479 | 479 |
| 480 TEST_F(ScriptPromisePropertyNonScriptWrappableResolutionTargetTest, | 480 TEST_F(ScriptPromisePropertyNonScriptWrappableResolutionTargetTest, |
| 481 ResolveWithInteger) { | 481 ResolveWithInteger) { |
| 482 test(-1, "-1", __FILE__, __LINE__); | 482 test(-1, "-1", __FILE__, __LINE__); |
| 483 } | 483 } |
| 484 | 484 |
| 485 } // namespace | 485 } // namespace |
| OLD | NEW |