Index: Source/core/css/parser/NewCSSTokenizerTest.cpp |
diff --git a/Source/heap/HeapTest.cpp b/Source/core/css/parser/NewCSSTokenizerTest.cpp |
similarity index 74% |
copy from Source/heap/HeapTest.cpp |
copy to Source/core/css/parser/NewCSSTokenizerTest.cpp |
index 02e39a5eb9e5ff7e429b2a6a31d79bcf6c788918..5acfe52cb5b31591857b4a80757490f98412591a 100644 |
--- a/Source/heap/HeapTest.cpp |
+++ b/Source/core/css/parser/NewCSSTokenizerTest.cpp |
@@ -30,7 +30,8 @@ |
#include "config.h" |
-#include "heap/Heap.h" |
+#include "core/css/parser/NewCSSTokenizer.h" |
+#include "wtf/PassOwnPtr.h" |
#include <gtest/gtest.h> |
@@ -38,10 +39,24 @@ using namespace WebCore; |
namespace { |
-TEST(HeapTest, Init) |
+void tokenize(String string, Vector<CSSToken>& outTokens) |
{ |
- Heap::init(0); |
- Heap::shutdown(); |
+ NewCSSTokenizer tokenizer; |
+ CSSInputStream input(string); |
+ while (true) { |
+ outTokens.append(tokenizer.nextToken(input)); |
+ if (outTokens.last().type() == EOFToken) |
+ return; |
+ } |
+} |
+ |
+TEST(CSSTokenizerTest, Basic) |
+{ |
+ Vector<CSSToken> tokens; |
+ tokenize("foo", tokens); |
+ printf("%zu\n", tokens.size()); |
+ for (size_t i = 0; i < tokens.size(); i++) |
+ printf("%zu: %i\n", i, tokens[i].type()); |
} |
} // namespace |