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

Unified Diff: Source/core/css/parser/NewCSSTokenizerTest.cpp

Issue 171383002: A thread-safe Media Query Parser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/css/parser/NewCSSTokenizerTest.cpp
diff --git a/Source/platform/PlatformThreadData.cpp b/Source/core/css/parser/NewCSSTokenizerTest.cpp
similarity index 71%
copy from Source/platform/PlatformThreadData.cpp
copy to Source/core/css/parser/NewCSSTokenizerTest.cpp
index b23dbed9d8e0a82d135e81fc75b4aef15f82d420..a3dd90290f41818a4acc300004eb6c3516254689 100644
--- a/Source/platform/PlatformThreadData.cpp
+++ b/Source/core/css/parser/NewCSSTokenizerTest.cpp
@@ -29,35 +29,25 @@
*/
#include "config.h"
-#include "platform/PlatformThreadData.h"
+#include "core/css/parser/NewCSSTokenizer.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, DelimToken, RightParenToken, EOFToken };
+ TestCase testCase1("(max-width: 50%)", (CSSTokenType*)&tokenTypeArr);
+ testcases.append(testCase1);
+ Vector<CSSToken> tokens;
+ NewCSSTokenizer::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

Powered by Google App Engine
This is Rietveld 408576698