| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/css/MediaQuery.h" | 6 #include "core/css/MediaQuery.h" |
| 7 | 7 |
| 8 #include "core/css/MediaList.h" | 8 #include "core/css/MediaList.h" |
| 9 #include "wtf/PassOwnPtr.h" | 9 #include "wtf/PassOwnPtr.h" |
| 10 #include "wtf/text/StringBuilder.h" | 10 #include "wtf/text/StringBuilder.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 {"(pointer: coarse)", 0}, | 112 {"(pointer: coarse)", 0}, |
| 113 {"(min-orientation:portrait)", "not all"}, | 113 {"(min-orientation:portrait)", "not all"}, |
| 114 {"all and (orientation:portrait)", "(orientation: portrait)"}, | 114 {"all and (orientation:portrait)", "(orientation: portrait)"}, |
| 115 {"all and (orientation:landscape)", "(orientation: landscape)"}, | 115 {"all and (orientation:landscape)", "(orientation: landscape)"}, |
| 116 {"NOT braille, tv AND (max-width: 200px) and (min-WIDTH: 100px) and (ori
entation: landscape), (color)", | 116 {"NOT braille, tv AND (max-width: 200px) and (min-WIDTH: 100px) and (ori
entation: landscape), (color)", |
| 117 "not braille, tv and (max-width: 200px) and (min-width: 100px) and (
orientation: landscape), (color)"}, | 117 "not braille, tv and (max-width: 200px) and (min-width: 100px) and (
orientation: landscape), (color)"}, |
| 118 {0, 0} // Do not remove the terminator line. | 118 {0, 0} // Do not remove the terminator line. |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 for (unsigned i = 0; testCases[i].input; ++i) { | 121 for (unsigned i = 0; testCases[i].input; ++i) { |
| 122 RefPtr<MediaQuerySet> querySet = MediaQuerySet::create(testCases[i].inpu
t); | 122 RefPtrWillBeRawPtr<MediaQuerySet> querySet = MediaQuerySet::create(testC
ases[i].input); |
| 123 StringBuilder output; | 123 StringBuilder output; |
| 124 char outputCharArray[outputCharArrayLen]; | 124 char outputCharArray[outputCharArrayLen]; |
| 125 size_t j = 0; | 125 size_t j = 0; |
| 126 while (j < querySet->queryVector().size()) { | 126 while (j < querySet->queryVector().size()) { |
| 127 String queryText = querySet->queryVector()[j]->cssText(); | 127 String queryText = querySet->queryVector()[j]->cssText(); |
| 128 output.append(queryText); | 128 output.append(queryText); |
| 129 ++j; | 129 ++j; |
| 130 if (j >= querySet->queryVector().size()) | 130 if (j >= querySet->queryVector().size()) |
| 131 break; | 131 break; |
| 132 output.append(", "); | 132 output.append(", "); |
| 133 } | 133 } |
| 134 ASSERT(output.length() < outputCharArrayLen); | 134 ASSERT(output.length() < outputCharArrayLen); |
| 135 getCharArray(output.toString(), outputCharArray); | 135 getCharArray(output.toString(), outputCharArray); |
| 136 if (testCases[i].output) | 136 if (testCases[i].output) |
| 137 ASSERT_STREQ(testCases[i].output, outputCharArray); | 137 ASSERT_STREQ(testCases[i].output, outputCharArray); |
| 138 else | 138 else |
| 139 ASSERT_STREQ(testCases[i].input, outputCharArray); | 139 ASSERT_STREQ(testCases[i].input, outputCharArray); |
| 140 } | 140 } |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace | 143 } // namespace |
| OLD | NEW |