[webkit-reviews] review granted: [Bug 180539] ApplicationManifestParser should strip whitespace from the raw input : [Attachment 328824] Patch v2

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 8 10:57:50 PST 2017


Joseph Pecoraro <joepeck at webkit.org> has granted David Quesada
<david_quesada at apple.com>'s request for review:
Bug 180539: ApplicationManifestParser should strip whitespace from the raw
input
https://bugs.webkit.org/show_bug.cgi?id=180539

Attachment 328824: Patch v2

https://bugs.webkit.org/attachment.cgi?id=328824&action=review




--- Comment #7 from Joseph Pecoraro <joepeck at webkit.org> ---
Comment on attachment 328824
  --> https://bugs.webkit.org/attachment.cgi?id=328824
Patch v2

View in context: https://bugs.webkit.org/attachment.cgi?id=328824&action=review

> Tools/TestWebKitAPI/Tests/WTF/JSONValue.cpp:645
> +    }

I'd suggest another section to test leading/trailing whitespace permutations:

    {
	RefPtr<JSON::Value> value;
	EXPECT_TRUE(JSON::Value::parseJSON(" 1", value));
	EXPECT_TRUE(JSON::Value::parseJSON("\t1", value));
	EXPECT_TRUE(JSON::Value::parseJSON("\n1", value));
	EXPECT_TRUE(JSON::Value::parseJSON("1 ", value));
	EXPECT_TRUE(JSON::Value::parseJSON("1\t", value));
	EXPECT_TRUE(JSON::Value::parseJSON("1\n", value));
	EXPECT_TRUE(JSON::Value::parseJSON(" 1 ", value));
	EXPECT_TRUE(JSON::Value::parseJSON(" {} ", value));
	EXPECT_TRUE(JSON::Value::parseJSON(" [] ", value));

	EXPECT_FALSE(JSON::Value::parseJSON("1 1", value));
	EXPECT_FALSE(JSON::Value::parseJSON("{} {}", value));
	EXPECT_FALSE(JSON::Value::parseJSON("[] []", value));
    }


More information about the webkit-reviews mailing list