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

Side by Side Diff: Source/core/css/MediaQueryEvaluatorTest.cpp

Issue 451113002: Updated hover media feature to comply updated media queries spec (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Change behind RuntimeEnabledFeature status=stable 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 unified diff | Download patch
« no previous file with comments | « Source/core/css/MediaQueryEvaluator.cpp ('k') | Source/core/css/MediaQueryExp.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "config.h" 5 #include "config.h"
6 #include "core/css/MediaQueryEvaluator.h" 6 #include "core/css/MediaQueryEvaluator.h"
7 7
8 #include "core/MediaTypeNames.h" 8 #include "core/MediaTypeNames.h"
9 #include "core/css/MediaList.h" 9 #include "core/css/MediaList.h"
10 #include "core/css/MediaValuesCached.h" 10 #include "core/css/MediaValuesCached.h"
(...skipping 26 matching lines...) Expand all
37 {"all and (monochrome)", 0}, 37 {"all and (monochrome)", 0},
38 {"all and (min-monochrome: 0)", 1}, 38 {"all and (min-monochrome: 0)", 1},
39 {"all and (grid: 0)", 1}, 39 {"all and (grid: 0)", 1},
40 {"(resolution: 2dppx)", 1}, 40 {"(resolution: 2dppx)", 1},
41 {"(resolution: 1dppx)", 0}, 41 {"(resolution: 1dppx)", 0},
42 {"(orientation: portrait)", 1}, 42 {"(orientation: portrait)", 1},
43 {"(orientation: landscape)", 0}, 43 {"(orientation: landscape)", 0},
44 {"tv and (scan: progressive)", 0}, 44 {"tv and (scan: progressive)", 0},
45 {"(pointer: coarse)", 0}, 45 {"(pointer: coarse)", 0},
46 {"(pointer: fine)", 1}, 46 {"(pointer: fine)", 1},
47 {"(hover: 1)", 1}, 47 {"(hover: hover)", 1},
48 {"(hover: 0)", 0}, 48 {"(hover: on-demand)", 0},
49 {"(hover: none)", 0},
49 {0, 0} // Do not remove the terminator line. 50 {0, 0} // Do not remove the terminator line.
50 }; 51 };
51 52
52 TestCase viewportTestCases[] = { 53 TestCase viewportTestCases[] = {
53 {"all and (min-width: 500px)", 1}, 54 {"all and (min-width: 500px)", 1},
54 {"(min-width: 500px)", 1}, 55 {"(min-width: 500px)", 1},
55 {"(min-width: 501px)", 0}, 56 {"(min-width: 501px)", 0},
56 {"(max-width: 500px)", 1}, 57 {"(max-width: 500px)", 1},
57 {"(max-width: 499px)", 0}, 58 {"(max-width: 499px)", 0},
58 {"(width: 500px)", 1}, 59 {"(width: 500px)", 1},
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 { 125 {
125 OwnPtr<DummyPageHolder> pageHolder = DummyPageHolder::create(IntSize(500, 50 0)); 126 OwnPtr<DummyPageHolder> pageHolder = DummyPageHolder::create(IntSize(500, 50 0));
126 pageHolder->frame().setView(nullptr); 127 pageHolder->frame().setView(nullptr);
127 MediaQueryEvaluator mediaQueryEvaluator(&pageHolder->frame()); 128 MediaQueryEvaluator mediaQueryEvaluator(&pageHolder->frame());
128 RefPtrWillBeRawPtr<MediaQuerySet> querySet = MediaQuerySet::create("foobar") ; 129 RefPtrWillBeRawPtr<MediaQuerySet> querySet = MediaQuerySet::create("foobar") ;
129 bool output = false; 130 bool output = false;
130 ASSERT_EQ(output, mediaQueryEvaluator.eval(querySet.get())); 131 ASSERT_EQ(output, mediaQueryEvaluator.eval(querySet.get()));
131 } 132 }
132 133
133 } // namespace 134 } // namespace
OLDNEW
« no previous file with comments | « Source/core/css/MediaQueryEvaluator.cpp ('k') | Source/core/css/MediaQueryExp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698