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

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

Issue 836373002: Make media query feature values more strict (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add two more tests Created 5 years, 11 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 | « no previous file | Source/core/css/parser/MediaQueryParser.h » ('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 23 matching lines...) Expand all
34 {"all and (min-color: 32)", 0}, 34 {"all and (min-color: 32)", 0},
35 {"all and (min-color-index: 0)", 1}, 35 {"all and (min-color-index: 0)", 1},
36 {"all and (min-color-index: 1)", 0}, 36 {"all and (min-color-index: 1)", 0},
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 {"(orientation: url(portrait))", 0},
45 {"(orientation: #portrait)", 0},
46 {"(orientation: @portrait)", 0},
47 {"(orientation: 'portrait')", 0},
48 {"(orientation: @junk portrait)", 0},
49 {"screen and (orientation: @portrait) and (max-width: 1000px)", 0},
50 {"screen and (orientation: @portrait), (max-width: 1000px)", 1},
44 {"tv and (scan: progressive)", 0}, 51 {"tv and (scan: progressive)", 0},
45 {"(pointer: coarse)", 0}, 52 {"(pointer: coarse)", 0},
46 {"(pointer: fine)", 1}, 53 {"(pointer: fine)", 1},
47 {"(hover: hover)", 1}, 54 {"(hover: hover)", 1},
48 {"(hover: on-demand)", 0}, 55 {"(hover: on-demand)", 0},
49 {"(hover: none)", 0}, 56 {"(hover: none)", 0},
50 {0, 0} // Do not remove the terminator line. 57 {0, 0} // Do not remove the terminator line.
51 }; 58 };
52 59
53 TestCase viewportTestCases[] = { 60 TestCase viewportTestCases[] = {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 RefPtrWillBePersistent<FrameView> view = pageHolder->frame().view(); 143 RefPtrWillBePersistent<FrameView> view = pageHolder->frame().view();
137 pageHolder->frame().setView(nullptr); 144 pageHolder->frame().setView(nullptr);
138 MediaQueryEvaluator mediaQueryEvaluator(&pageHolder->frame()); 145 MediaQueryEvaluator mediaQueryEvaluator(&pageHolder->frame());
139 RefPtrWillBePersistent<MediaQuerySet> querySet = MediaQuerySet::create("foob ar"); 146 RefPtrWillBePersistent<MediaQuerySet> querySet = MediaQuerySet::create("foob ar");
140 bool output = false; 147 bool output = false;
141 ASSERT_EQ(output, mediaQueryEvaluator.eval(querySet.get())); 148 ASSERT_EQ(output, mediaQueryEvaluator.eval(querySet.get()));
142 pageHolder->frame().setView(view); 149 pageHolder->frame().setView(view);
143 } 150 }
144 151
145 } // namespace 152 } // namespace
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/parser/MediaQueryParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698