Index: Source/core/css/parser/MediaQueryTokenizerTest.cpp |
diff --git a/Source/platform/PlatformThreadData.cpp b/Source/core/css/parser/MediaQueryTokenizerTest.cpp |
similarity index 71% |
copy from Source/platform/PlatformThreadData.cpp |
copy to Source/core/css/parser/MediaQueryTokenizerTest.cpp |
index b23dbed9d8e0a82d135e81fc75b4aef15f82d420..685167a90f9c28aa23dd370f58d3b71ab32d3b28 100644 |
--- a/Source/platform/PlatformThreadData.cpp |
+++ b/Source/core/css/parser/MediaQueryTokenizerTest.cpp |
@@ -29,35 +29,25 @@ |
*/ |
#include "config.h" |
-#include "platform/PlatformThreadData.h" |
+#include "core/css/parser/MediaQueryTokenizer.h" |
-#include "platform/ThreadTimers.h" |
#include "wtf/PassOwnPtr.h" |
-#include "wtf/ThreadSpecific.h" |
+#include <gtest/gtest.h> |
namespace WebCore { |
-static ThreadSpecific<PlatformThreadData>* s_data; |
- |
-PlatformThreadData::PlatformThreadData() |
- : m_threadTimers(adoptPtr(new ThreadTimers)) |
-{ |
-} |
- |
-PlatformThreadData::~PlatformThreadData() |
-{ |
-} |
- |
-void PlatformThreadData::destroy() |
-{ |
- m_threadTimers.clear(); |
-} |
- |
-PlatformThreadData& PlatformThreadData::current() |
+typedef pair<String, CSSTokenType* > TestCase; |
+TEST(CSSTokenizerTest, Basic) |
{ |
- if (!s_data) |
- s_data = new ThreadSpecific<PlatformThreadData>; |
- return **s_data; |
+ Vector<TestCase> testcases; |
+ CSSTokenType tokenTypeArr[] = {LeftParenToken, IdentToken, ColonToken, WhitespaceToken, PercentageToken, RightParenToken, EOFToken }; |
+ TestCase testCase1("(max-width: 50%)", (CSSTokenType*)&tokenTypeArr); |
+ testcases.append(testCase1); |
+ Vector<CSSToken> tokens; |
+ MediaQueryTokenizer::tokenize(testcases[0].first, tokens); |
+ for (size_t i = 0; i < tokens.size(); i++) { |
+ ASSERT_EQ(testcases[0].second[i], tokens[i].type()); |
+ } |
} |
-} // namespace WebCore |
+} // namespace |