Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(548)

Unified Diff: Source/core/css/MediaQueryListTest.cpp

Issue 396283004: Make the MediaQueryList listener an EventListener (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/MediaQueryListListener.cpp ('k') | Source/core/css/MediaQueryMatcher.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « Source/core/css/MediaQueryListListener.cpp ('k') | Source/core/css/MediaQueryMatcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698