static v8::Handle<v8::Value> addListenerCallback(const v8::Arguments& args) { MediaQueryList* imp = V8MediaQueryList::toNative(args.Holder()); V8TRYCATCH(RefPtr<MediaQueryListListener>, listener, MediaQueryListListener::create(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))); imp->addListener(listener); return v8Undefined(); }
TEST(MediaQueryListTest, CrashInStop) { Document* document = Document::create(); MediaQueryList* list = MediaQueryList::create(document, MediaQueryMatcher::create(*document), MediaQuerySet::create()); list->addListener(new TestListener()); list->stop(); // This test passes if it's not crashed. }