| 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/parser/CSSTokenizer.h" | 5 #include "core/css/parser/CSSTokenizer.h" |
| 6 | 6 |
| 7 #include "core/css/parser/CSSParserTokenRange.h" | 7 #include "core/css/parser/CSSParserTokenRange.h" |
| 8 #include "core/css/parser/MediaQueryBlockWatcher.h" | 8 #include "core/css/parser/MediaQueryBlockWatcher.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "wtf/Partitions.h" | 10 #include "wtf/Partitions.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 case PercentageToken: | 42 case PercentageToken: |
| 43 ASSERT_EQ(expected.numericValueType(), actual.numericValueType()); | 43 ASSERT_EQ(expected.numericValueType(), actual.numericValueType()); |
| 44 ASSERT_DOUBLE_EQ(expected.numericValue(), actual.numericValue()); | 44 ASSERT_DOUBLE_EQ(expected.numericValue(), actual.numericValue()); |
| 45 break; | 45 break; |
| 46 case UnicodeRangeToken: | 46 case UnicodeRangeToken: |
| 47 ASSERT_EQ(expected.unicodeRangeStart(), actual.unicodeRangeStart()); | 47 ASSERT_EQ(expected.unicodeRangeStart(), actual.unicodeRangeStart()); |
| 48 ASSERT_EQ(expected.unicodeRangeEnd(), actual.unicodeRangeEnd()); | 48 ASSERT_EQ(expected.unicodeRangeEnd(), actual.unicodeRangeEnd()); |
| 49 break; | 49 break; |
| 50 case HashToken: | 50 case HashToken: |
| 51 ASSERT_EQ(String(expected.value()), String(actual.value())); | 51 ASSERT_EQ(String(expected.value()), String(actual.value())); |
| 52 ASSERT_EQ(expected.hashTokenType(), actual.hashTokenType()); | 52 ASSERT_EQ(expected.getHashTokenType(), actual.getHashTokenType()); |
| 53 break; | 53 break; |
| 54 default: | 54 default: |
| 55 break; | 55 break; |
| 56 } | 56 } |
| 57 } | 57 } |
| 58 | 58 |
| 59 void testTokens(const String& string, const CSSParserToken& token1, const CSSPar
serToken& token2 = CSSParserToken(EOFToken), const CSSParserToken& token3 = CSSP
arserToken(EOFToken)) | 59 void testTokens(const String& string, const CSSParserToken& token1, const CSSPar
serToken& token2 = CSSParserToken(EOFToken), const CSSParserToken& token3 = CSSP
arserToken(EOFToken)) |
| 60 { | 60 { |
| 61 Vector<CSSParserToken> expectedTokens; | 61 Vector<CSSParserToken> expectedTokens; |
| 62 expectedTokens.append(token1); | 62 expectedTokens.append(token1); |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 blockWatcher.handleToken(range.consume()); | 493 blockWatcher.handleToken(range.consume()); |
| 494 level = blockWatcher.blockLevel(); | 494 level = blockWatcher.blockLevel(); |
| 495 maxLevel = std::max(level, maxLevel); | 495 maxLevel = std::max(level, maxLevel); |
| 496 } | 496 } |
| 497 ASSERT_EQ(testCases[i].maxLevel, maxLevel); | 497 ASSERT_EQ(testCases[i].maxLevel, maxLevel); |
| 498 ASSERT_EQ(testCases[i].finalLevel, level); | 498 ASSERT_EQ(testCases[i].finalLevel, level); |
| 499 } | 499 } |
| 500 } | 500 } |
| 501 | 501 |
| 502 } // namespace blink | 502 } // namespace blink |
| OLD | NEW |