Commit 097a6539 authored by yoav@yoav.ws's avatar yoav@yoav.ws

Initialize all ImageCandidate's member variables

While re-reading the code, I noticed that some of ImageCandidate's member variables
are not initialized as they should.
This CL fixes that.

BUG=

Review URL: https://codereview.chromium.org/311053011

git-svn-id: svn://svn.chromium.org/blink/trunk@175758 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 4598c7a0
...@@ -74,6 +74,8 @@ public: ...@@ -74,6 +74,8 @@ public:
ImageCandidate() ImageCandidate()
: m_density(1.0) : m_density(1.0)
, m_resourceWidth(UninitializedDescriptor)
, m_originAttribute(SrcsetOrigin)
{ {
} }
......
...@@ -20,6 +20,15 @@ typedef struct { ...@@ -20,6 +20,15 @@ typedef struct {
int outputResourceWidth; int outputResourceWidth;
} TestCase; } TestCase;
TEST(ImageCandidateTest, Basic)
{
ImageCandidate candidate;
ASSERT_EQ(candidate.density(), 1);
ASSERT_EQ(candidate.resourceWidth(), -1);
ASSERT_EQ(candidate.srcOrigin(), false);
}
TEST(HTMLSrcsetParserTest, Basic) TEST(HTMLSrcsetParserTest, Basic)
{ {
TestCase testCases[] = { TestCase testCases[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment