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

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

Issue 2208283002: [Typed-OM] Add CSSURLImageValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@CSSProperties_Image
Patch Set: Rebase Created 4 years, 4 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/CSSURLImageValue.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/CSSURLImageValueTest.cpp
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSURLImageValueTest.cpp b/third_party/WebKit/Source/core/css/cssom/CSSURLImageValueTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e5a760c18987bc50b8efdfba72c86d8c864b5751
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/cssom/CSSURLImageValueTest.cpp
@@ -0,0 +1,35 @@
+// 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/CSSURLImageValue.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace blink {
+
+namespace {
+
+void checkNullURLImageValue(CSSURLImageValue* urlImageValue)
+{
+ EXPECT_EQ(urlImageValue->state(), "unloaded");
+ bool isNull;
+ EXPECT_EQ(urlImageValue->intrinsicWidth(isNull), 0);
+ EXPECT_EQ(urlImageValue->intrinsicHeight(isNull), 0);
+ EXPECT_EQ(urlImageValue->intrinsicRatio(isNull), 0);
+ EXPECT_TRUE(isNull);
+}
+
+TEST(CSSURLImageValueTest, CreateURLImageValueFromURL)
+{
+ checkNullURLImageValue(CSSURLImageValue::create("http://localhost"));
+}
+
+TEST(CSSURLImageValueTest, CreateURLImageValueFromImageValue)
+{
+ checkNullURLImageValue(CSSURLImageValue::create(CSSImageValue::create("http://localhost")));
+}
+
+} // namespace
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/css/cssom/CSSURLImageValue.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698