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 "config.h" | 5 #include "config.h" |
6 #include "bindings/core/v8/ScriptPromiseResolver.h" | 6 #include "bindings/core/v8/ScriptPromiseResolver.h" |
7 | 7 |
8 #include "bindings/core/v8/ScriptFunction.h" | 8 #include "bindings/core/v8/ScriptFunction.h" |
9 #include "bindings/core/v8/ScriptValue.h" | 9 #include "bindings/core/v8/ScriptValue.h" |
10 #include "bindings/core/v8/V8Binding.h" | 10 #include "bindings/core/v8/V8Binding.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 return self->bindToV8Function(); | 30 return self->bindToV8Function(); |
31 } | 31 } |
32 | 32 |
33 private: | 33 private: |
34 Function(ScriptState* scriptState, String* value) | 34 Function(ScriptState* scriptState, String* value) |
35 : ScriptFunction(scriptState) | 35 : ScriptFunction(scriptState) |
36 , m_value(value) | 36 , m_value(value) |
37 { | 37 { |
38 } | 38 } |
39 | 39 |
40 virtual ScriptValue call(ScriptValue value) OVERRIDE | 40 virtual ScriptValue call(ScriptValue value) override |
41 { | 41 { |
42 ASSERT(!value.isEmpty()); | 42 ASSERT(!value.isEmpty()); |
43 *m_value = toCoreString(value.v8Value()->ToString()); | 43 *m_value = toCoreString(value.v8Value()->ToString()); |
44 return value; | 44 return value; |
45 } | 45 } |
46 | 46 |
47 String* m_value; | 47 String* m_value; |
48 }; | 48 }; |
49 | 49 |
50 class ScriptPromiseResolverTest : public ::testing::Test { | 50 class ScriptPromiseResolverTest : public ::testing::Test { |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 resolver->reject(); | 311 resolver->reject(); |
312 isolate()->RunMicrotasks(); | 312 isolate()->RunMicrotasks(); |
313 | 313 |
314 EXPECT_EQ(String(), onFulfilled); | 314 EXPECT_EQ(String(), onFulfilled); |
315 EXPECT_EQ("undefined", onRejected); | 315 EXPECT_EQ("undefined", onRejected); |
316 } | 316 } |
317 | 317 |
318 } // namespace | 318 } // namespace |
319 | 319 |
320 } // namespace blink | 320 } // namespace blink |
OLD | NEW |