| Index: Source/core/css/MediaQueryListTest.cpp
|
| diff --git a/Source/core/css/MediaQueryListTest.cpp b/Source/core/css/MediaQueryListTest.cpp
|
| index fc0e9ff93243f2fe01aacdda719ca76d1d295e5e..d5d807f0174c007e0fa5962180490dc67d03e1b2 100644
|
| --- a/Source/core/css/MediaQueryListTest.cpp
|
| +++ b/Source/core/css/MediaQueryListTest.cpp
|
| @@ -5,22 +5,28 @@
|
| #include "config.h"
|
| #include "core/css/MediaQueryList.h"
|
|
|
| -#include "bindings/core/v8/V8Binding.h"
|
| #include "core/css/MediaList.h"
|
| #include "core/css/MediaQueryListListener.h"
|
| #include "core/css/MediaQueryMatcher.h"
|
| #include "core/dom/Document.h"
|
| #include <gtest/gtest.h>
|
|
|
| +namespace {
|
| +
|
| +class TestListener : public blink::MediaQueryListListener {
|
| +public:
|
| + virtual void call() OVERRIDE { }
|
| +};
|
| +
|
| +}
|
| +
|
| namespace blink {
|
|
|
| TEST(MediaQueryListTest, CrashInStop)
|
| {
|
| - V8TestingScope scope(v8::Isolate::GetCurrent());
|
| RefPtrWillBeRawPtr<Document> document = Document::create();
|
| RefPtrWillBeRawPtr<MediaQueryList> list = MediaQueryList::create(document.get(), MediaQueryMatcher::create(*document), MediaQuerySet::create());
|
| - v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(scope.isolate());
|
| - list->addListener(MediaQueryListListener::create(scope.scriptState(), ScriptValue(scope.scriptState(), templ->GetFunction())));
|
| + list->addListener(adoptRefWillBeNoop(new TestListener()));
|
| // Now, MediaQueryList and MediaQueryListListener have reference cycle. We
|
| // can clear |list|.
|
| MediaQueryList* rawList = list.release().get();
|
|
|