| Index: Source/web/tests/CustomEventTest.cpp
|
| diff --git a/Source/web/tests/CustomEventTest.cpp b/Source/web/tests/CustomEventTest.cpp
|
| index 8070fc323a6058ad0b69845c26dc8c12ce909473..65abe089c85466d27d0dcfc0835cc9c3ded219ed 100644
|
| --- a/Source/web/tests/CustomEventTest.cpp
|
| +++ b/Source/web/tests/CustomEventTest.cpp
|
| @@ -55,7 +55,7 @@ namespace {
|
|
|
| class TestListener : public V8AbstractEventListener {
|
| public:
|
| - virtual bool operator==(const EventListener& listener)
|
| + virtual bool operator==(const EventListener&)
|
| {
|
| return true;
|
| }
|
| @@ -64,22 +64,20 @@ public:
|
| {
|
| EXPECT_EQ(event->type(), "blah");
|
|
|
| - v8::Local<v8::Context> v8Context = WebCore::toV8Context(context, DOMWrapperWorld::mainWorld());
|
| - v8::Isolate* isolate = v8Context->GetIsolate();
|
| - v8::Context::Scope scope(v8Context);
|
| - v8::Handle<v8::Value> jsEvent = toV8(event, v8::Handle<v8::Object>(), isolate);
|
| + ScriptState::Scope scope(scriptState());
|
| + v8::Handle<v8::Value> jsEvent = toV8(event, scriptState()->context()->Global(), isolate());
|
|
|
| - EXPECT_EQ(jsEvent->ToObject()->Get(v8::String::NewFromUtf8(isolate, "detail")), v8::Boolean::New(isolate, true));
|
| + EXPECT_EQ(jsEvent->ToObject()->Get(v8::String::NewFromUtf8(scriptState()->isolate(), "detail")), v8::Boolean::New(scriptState()->isolate(), true));
|
| }
|
|
|
| - static PassRefPtr<TestListener> create(v8::Isolate* isolate, DOMWrapperWorld& world)
|
| + static PassRefPtr<TestListener> create(ScriptState* scriptState)
|
| {
|
| - return adoptRef(new TestListener(isolate, world));
|
| + return adoptRef(new TestListener(scriptState));
|
| }
|
|
|
| private:
|
| - TestListener(v8::Isolate* isolate, DOMWrapperWorld& world)
|
| - : V8AbstractEventListener(false, world, isolate)
|
| + TestListener(ScriptState* scriptState)
|
| + : V8AbstractEventListener(false, scriptState)
|
| {
|
| }
|
|
|
| @@ -108,10 +106,9 @@ TEST(CustomEventTest, InitWithSerializedScriptValue)
|
| WebDOMCustomEvent customEvent = event.to<WebDOMCustomEvent>();
|
|
|
| v8::Isolate* isolate = toIsolate(frame->frame());
|
| - v8::HandleScope handleScope(isolate);
|
| + V8ExecutionScope scope(isolate);
|
| customEvent.initCustomEvent("blah", false, false, WebSerializedScriptValue::serialize(v8::Boolean::New(isolate, true)));
|
| - RefPtr<DOMWrapperWorld> world = DOMWrapperWorld::create();
|
| - RefPtr<EventListener> listener = TestListener::create(isolate, *world);
|
| + RefPtr<EventListener> listener = TestListener::create(ScriptState::current(isolate));
|
| frame->frame()->document()->addEventListener("blah", listener, false);
|
| frame->frame()->document()->dispatchEvent(event);
|
|
|
|
|