| 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 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 namespace WebCore { | 41 namespace WebCore { |
| 42 | 42 |
| 43 namespace { | 43 namespace { |
| 44 | 44 |
| 45 class ScriptPromiseResolverTest : public testing::Test { | 45 class ScriptPromiseResolverTest : public testing::Test { |
| 46 public: | 46 public: |
| 47 ScriptPromiseResolverTest() | 47 ScriptPromiseResolverTest() |
| 48 : m_isolate(v8::Isolate::GetCurrent()) | 48 : m_isolate(v8::Isolate::GetCurrent()) |
| 49 , m_handleScope(m_isolate) | 49 , m_handleScope(m_isolate) |
| 50 , m_context(v8::Context::New(m_isolate)) | 50 , m_context(m_isolate, v8::Context::New(m_isolate)) |
| 51 , m_contextScope(m_context.newLocal(m_isolate)) | 51 , m_contextScope(m_context.newLocal(m_isolate)) |
| 52 { | 52 { |
| 53 } | 53 } |
| 54 | 54 |
| 55 void SetUp() | 55 void SetUp() |
| 56 { | 56 { |
| 57 m_perContextData = V8PerContextData::create(m_context.newLocal(m_isolate
)); | 57 m_perContextData = V8PerContextData::create(m_context.newLocal(m_isolate
)); |
| 58 m_perContextData->init(); | 58 m_perContextData->init(); |
| 59 m_resolver = ScriptPromiseResolver::create(); | 59 m_resolver = ScriptPromiseResolver::create(); |
| 60 m_promise = m_resolver->promise(); | 60 m_promise = m_resolver->promise(); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 m_resolver->detach(); | 191 m_resolver->detach(); |
| 192 | 192 |
| 193 EXPECT_FALSE(m_resolver->isPending()); | 193 EXPECT_FALSE(m_resolver->isPending()); |
| 194 EXPECT_EQ(V8PromiseCustom::Rejected, state()); | 194 EXPECT_EQ(V8PromiseCustom::Rejected, state()); |
| 195 EXPECT_TRUE(result()->IsUndefined()); | 195 EXPECT_TRUE(result()->IsUndefined()); |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace | 198 } // namespace |
| 199 | 199 |
| 200 } // namespace WebCore | 200 } // namespace WebCore |
| OLD | NEW |