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> pageHolder = | 16 std::unique_ptr<DummyPageHolder> pageHolder = |
17 DummyPageHolder::create(IntSize(500, 500)); | 17 DummyPageHolder::create(IntSize(500, 500)); |
18 MediaQueryMatcher* matcher = | 18 MediaQueryMatcher* matcher = |
19 MediaQueryMatcher::create(pageHolder->document()); | 19 MediaQueryMatcher::create(pageHolder->document()); |
20 MediaQuerySet* querySet = MediaQuerySet::create(MediaTypeNames::all); | 20 MediaQuerySet* querySet = MediaQuerySet::create(MediaTypeNames::all); |
21 ASSERT_TRUE(matcher->evaluate(querySet)); | 21 ASSERT_TRUE(matcher->evaluate(querySet)); |
22 | 22 |
23 matcher->documentDetached(); | 23 matcher->documentDetached(); |
24 ASSERT_FALSE(matcher->evaluate(querySet)); | 24 ASSERT_FALSE(matcher->evaluate(querySet)); |
25 } | 25 } |
26 | 26 |
27 } // namespace blink | 27 } // namespace blink |
OLD | NEW |