| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 v8::Handle<v8::Context> context(m_context.newLocal(m_isolate)); | 58 v8::Handle<v8::Context> context(m_context.newLocal(m_isolate)); |
| 59 V8PerContextDataHolder::install(context, DOMWrapperWorld::current(m_isol
ate)); | 59 V8PerContextDataHolder::install(context, DOMWrapperWorld::current(m_isol
ate)); |
| 60 m_perContextData = V8PerContextData::create(context); | 60 m_perContextData = V8PerContextData::create(context); |
| 61 m_perContextData->init(); | 61 m_perContextData->init(); |
| 62 m_promise = ScriptPromise::createPending(); | 62 m_promise = ScriptPromise::createPending(); |
| 63 m_resolver = ScriptPromiseResolver::create(m_promise); | 63 m_resolver = ScriptPromiseResolver::create(m_promise); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void TearDown() | 66 void TearDown() |
| 67 { | 67 { |
| 68 m_resolver = 0; | 68 m_resolver = nullptr; |
| 69 m_promise.clear(); | 69 m_promise.clear(); |
| 70 m_perContextData.clear(); | 70 m_perContextData.clear(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 V8PromiseCustom::PromiseState state() | 73 V8PromiseCustom::PromiseState state() |
| 74 { | 74 { |
| 75 return V8PromiseCustom::getState(V8PromiseCustom::getInternal(promise())
); | 75 return V8PromiseCustom::getState(V8PromiseCustom::getInternal(promise())
); |
| 76 } | 76 } |
| 77 | 77 |
| 78 v8::Local<v8::Value> result() | 78 v8::Local<v8::Value> result() |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 m_resolver->reject(ScriptValue(v8::Integer::New(m_isolate, 4), m_isolate)); | 167 m_resolver->reject(ScriptValue(v8::Integer::New(m_isolate, 4), m_isolate)); |
| 168 EXPECT_FALSE(m_resolver->isPending()); | 168 EXPECT_FALSE(m_resolver->isPending()); |
| 169 EXPECT_EQ(V8PromiseCustom::Fulfilled, state()); | 169 EXPECT_EQ(V8PromiseCustom::Fulfilled, state()); |
| 170 ASSERT_TRUE(result()->IsNumber()); | 170 ASSERT_TRUE(result()->IsNumber()); |
| 171 EXPECT_EQ(3, result().As<v8::Integer>()->Value()); | 171 EXPECT_EQ(3, result().As<v8::Integer>()->Value()); |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace | 174 } // namespace |
| 175 | 175 |
| 176 } // namespace WebCore | 176 } // namespace WebCore |
| OLD | NEW |