| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/css/MediaQueryMatcher.h" | 5 #include "core/css/MediaQueryMatcher.h" |
| 6 | 6 |
| 7 #include <memory> |
| 7 #include "core/MediaTypeNames.h" | 8 #include "core/MediaTypeNames.h" |
| 8 #include "core/css/MediaList.h" | 9 #include "core/css/MediaList.h" |
| 9 #include "core/testing/DummyPageHolder.h" | 10 #include "core/testing/DummyPageHolder.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include <memory> | |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 TEST(MediaQueryMatcherTest, LostFrame) { | 15 TEST(MediaQueryMatcherTest, LostFrame) { |
| 16 std::unique_ptr<DummyPageHolder> page_holder = | 16 std::unique_ptr<DummyPageHolder> page_holder = |
| 17 DummyPageHolder::Create(IntSize(500, 500)); | 17 DummyPageHolder::Create(IntSize(500, 500)); |
| 18 MediaQueryMatcher* matcher = | 18 MediaQueryMatcher* matcher = |
| 19 MediaQueryMatcher::Create(page_holder->GetDocument()); | 19 MediaQueryMatcher::Create(page_holder->GetDocument()); |
| 20 RefPtr<MediaQuerySet> query_set = MediaQuerySet::Create(MediaTypeNames::all); | 20 RefPtr<MediaQuerySet> query_set = MediaQuerySet::Create(MediaTypeNames::all); |
| 21 ASSERT_TRUE(matcher->Evaluate(query_set.Get())); | 21 ASSERT_TRUE(matcher->Evaluate(query_set.Get())); |
| 22 | 22 |
| 23 matcher->DocumentDetached(); | 23 matcher->DocumentDetached(); |
| 24 ASSERT_FALSE(matcher->Evaluate(query_set.Get())); | 24 ASSERT_FALSE(matcher->Evaluate(query_set.Get())); |
| 25 } | 25 } |
| 26 | 26 |
| 27 } // namespace blink | 27 } // namespace blink |
| OLD | NEW |