chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_unittest.cc
// Create a condition with two attributes: one on the request header and one on
// the response header. The Create() method should fail and complain that it is
// impossible that both conditions are fulfilled at the same time.
Create a condition with two attributes: one on the request header and one on
the response header. The Create() method should fail and complain that it is
impossible that both conditions are fulfilled at the same time.
Create a condition with two attributes : one on the request header and one on the response header . The Create () method should fail and complain that it is impossible that both conditions are fulfilled at the same time .
TEST(WebRequestConditionTest, ConditionsWithConflictingStages) {
  MessageLoop message_loop(MessageLoop::TYPE_IO);
  URLMatcher matcher;
  std::string error;
  scoped_ptr<WebRequestCondition> result;
  DictionaryValue condition_value;
  condition_value.SetString(keys::kInstanceTypeKey, keys::kRequestMatcherType);
  error.clear();
  result = WebRequestCondition::Create(
      matcher.condition_factory(),
      *base::test::ParseJson(
          "{ \n"
          "  \"instanceType\": \"declarativeWebRequest.RequestMatcher\", \n"
          "  \"requestHeaders\": [{}], \n"
          "  \"responseHeaders\": [{}], \n"
          "}"),
      &error);
  EXPECT_FALSE(error.empty());
  EXPECT_FALSE(result.get());
}
TEST ( WebRequestConditionTest , ConditionsWithConflictingStages ) { MessageLoop message_loop ( MessageLoop :: TYPE_IO ) ; URLMatcher matcher ; std :: string error ; scoped_ptr < WebRequestCondition > result ; DictionaryValue condition_value ; condition_value . SetString ( keys :: kInstanceTypeKey , keys :: kRequestMatcherType ) ; error . clear ( ) ; result = WebRequestCondition :: Create ( matcher . condition_factory ( ) , * base :: test :: ParseJson ( " \n " " \" \" \" \" \n " " \" \" \n " " \" \" \n " " " ) , & error ) ; EXPECT_FALSE ( error . empty ( ) ) ; EXPECT_FALSE ( result . get ( ) ) ; }
Create a condition with two attributes: one on the request header and one on
the response header.
Create a condition with two attributes : one on the request header and one on the response header .
// Necessary for TestURLRequest. // Test error on incompatible application stages for involved attributes. // Pass a JS array with one empty object to each of the header // filters.