src/net/http/structured_headers_unittest.cc
TEST(StructuredHeaderTest, ParseSH09Item) {
  for (const auto& c : sh09_item_test_cases) {
    SCOPED_TRACE(c.name);
    base::Optional<ListOfLists> result = ParseListOfLists(c.raw);
    if (c.expected.has_value()) {
      EXPECT_TRUE(result.has_value());
      EXPECT_EQ(result->size(), 1UL);
      EXPECT_EQ((*result)[0].size(), 1UL);
      EXPECT_EQ((*result)[0][0], c.expected);
    } else {
      EXPECT_FALSE(result.has_value());
    }
  }
}
// Structured Headers Draft 9 parsing rules are different than Draft 15, and
// some strings which are considered invalid in SH15 should parse in SH09.
// The SH09 Item parser is not directly exposed, but can be used indirectly by
// calling the parser for SH09-specific lists.
Structured Headers Draft 9 parsing rules are different than Draft 15, and
some strings which are considered invalid in SH15 should parse in SH09.
The SH09 Item parser is not directly exposed, but can be used indirectly by
calling the parser for SH09-specific lists.
Structured Headers Draft 9 parsing rules are different than Draft 15 and some strings which are considered invalid in SH15 should parse in SH09 . The SH09 Item parser is not directly exposed but can be used indirectly by calling the parser for SH09 - specific lists .
TEST(StructuredHeaderTest, ParseSH09Item) {
  for (const auto& c : sh09_item_test_cases) {
    SCOPED_TRACE(c.name);
    base::Optional<ListOfLists> result = ParseListOfLists(c.raw);
    if (c.expected.has_value()) {
      EXPECT_TRUE(result.has_value());
      EXPECT_EQ(result->size(), 1UL);
      EXPECT_EQ((*result)[0].size(), 1UL);
      EXPECT_EQ((*result)[0][0], c.expected);
    } else {
      EXPECT_FALSE(result.has_value());
    }
  }
}
TEST ( StructuredHeaderTest , ParseSH09Item ) { for ( const auto & c : sh09_item_test_cases ) { SCOPED_TRACE ( c . name ) ; base :: Optional < ListOfLists > result = ParseListOfLists ( c . raw ) ; if ( c . expected . has_value ( ) ) { EXPECT_TRUE ( result . has_value ( ) ) ; EXPECT_EQ ( result -> size ( ) , 1UL ) ; EXPECT_EQ ( ( * result ) [ 0 ] . size ( ) , 1UL ) ; EXPECT_EQ ( ( * result ) [ 0 ] [ 0 ] , c . expected ) ; } else { EXPECT_FALSE ( result . has_value ( ) ) ; } } }
Structured Headers Draft 9 parsing rules are different than Draft 15, and
some strings which are considered invalid in SH15 should parse in SH09.
Structured Headers Draft 9 parsing rules are different than Draft 15 and some strings which are considered invalid in SH15 should parse in SH09 .