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

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 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
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},
44 {"tv and (scan: progressive)", 0}, 48 {"tv and (scan: progressive)", 0},
45 {"(pointer: coarse)", 0}, 49 {"(pointer: coarse)", 0},
46 {"(pointer: fine)", 1}, 50 {"(pointer: fine)", 1},
47 {"(hover: hover)", 1}, 51 {"(hover: hover)", 1},
48 {"(hover: on-demand)", 0}, 52 {"(hover: on-demand)", 0},
49 {"(hover: none)", 0}, 53 {"(hover: none)", 0},
50 {0, 0} // Do not remove the terminator line. 54 {0, 0} // Do not remove the terminator line.
51 }; 55 };
52 56
53 TestCase viewportTestCases[] = { 57 TestCase viewportTestCases[] = {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 RefPtrWillBePersistent<FrameView> view = pageHolder->frame().view(); 140 RefPtrWillBePersistent<FrameView> view = pageHolder->frame().view();
137 pageHolder->frame().setView(nullptr); 141 pageHolder->frame().setView(nullptr);
138 MediaQueryEvaluator mediaQueryEvaluator(&pageHolder->frame()); 142 MediaQueryEvaluator mediaQueryEvaluator(&pageHolder->frame());
139 RefPtrWillBePersistent<MediaQuerySet> querySet = MediaQuerySet::create("foob ar"); 143 RefPtrWillBePersistent<MediaQuerySet> querySet = MediaQuerySet::create("foob ar");
140 bool output = false; 144 bool output = false;
141 ASSERT_EQ(output, mediaQueryEvaluator.eval(querySet.get())); 145 ASSERT_EQ(output, mediaQueryEvaluator.eval(querySet.get()));
142 pageHolder->frame().setView(view); 146 pageHolder->frame().setView(view);
143 } 147 }
144 148
145 } // namespace 149 } // namespace
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/parser/MediaQueryParser.h » ('j') | Source/core/css/parser/MediaQueryParser.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698