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

Unified Diff: third_party/WebKit/Source/core/css/cssom/CSSTokenStreamValueTest.cpp

Issue 2122193003: [Typed-OM] Add CSSTokenStreamValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test for CSSTokenStreamValue Created 4 years, 5 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
« no previous file with comments | « third_party/WebKit/Source/core/css/cssom/CSSTokenStreamValue.idl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/cssom/CSSTokenStreamValueTest.cpp
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSTokenStreamValueTest.cpp b/third_party/WebKit/Source/core/css/cssom/CSSTokenStreamValueTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..398c121910d58aa02b92f1d5e5addda0af464ec9
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/cssom/CSSTokenStreamValueTest.cpp
@@ -0,0 +1,39 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/css/cssom/CSSTokenStreamValue.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace blink {
+
+namespace {
+
+CSSTokenStreamValue* tokenStreamValueFromString(String str)
+{
+ Vector<String> fragments;
+ fragments.append(str);
+ return CSSTokenStreamValue::create(fragments);
+}
+
+TEST(CSSTokenStreamValueTest, EmptyList)
+{
+ Vector<String> fragments;
+
+ CSSTokenStreamValue* tokenStreamValue = CSSTokenStreamValue::create(fragments);
+
+ EXPECT_EQ(tokenStreamValue->size(), 0UL);
+}
+
+TEST(CSSTokenStreamValueTest, ListOfString)
+{
+ CSSTokenStreamValue* tokenStreamValue = tokenStreamValueFromString("Str");
+
+ EXPECT_EQ(tokenStreamValue->size(), 1UL);
+ EXPECT_EQ(tokenStreamValue->fragmentAtIndex(0), "Str");
+}
+
+} // namespace
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/css/cssom/CSSTokenStreamValue.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698