Lines Matching defs:rule
29 struct Rule {
30 Rule(const GURL& url,
51 Rule AddSuccessRule(const char* url) {
52 Rule rule(GURL(url), OK /*fetch_error*/, OK /*set_pac_error*/);
53 rules_.push_back(rule);
54 return rule;
58 rules_.push_back(Rule(GURL(url), kFailedDownloading /*fetch_error*/,
63 rules_.push_back(Rule(GURL(url), OK /*fetch_error*/,
67 const Rule& GetRuleByUrl(const GURL& url) const {
73 LOG(FATAL) << "Rule not found for " << url;
77 const Rule& GetRuleByText(const string16& text) const {
83 LOG(FATAL) << "Rule not found for " << text;
88 typedef std::vector<Rule> RuleList;
100 const Rules::Rule& rule = rules_->GetRuleByUrl(url);
101 int rv = rule.fetch_error;
104 *text = rule.text();
147 const Rules::Rule& rule = expects_pac_bytes() ?
151 int rv = rule.set_pac_error;
155 EXPECT_EQ(rule.text(), script_data->utf16());
157 EXPECT_EQ(rule.url, url);
181 Rules::Rule rule = rules.AddSuccessRule("http://custom/proxy.pac");
187 EXPECT_EQ(rule.text(), resolver.script_data()->utf16());
283 Rules::Rule rule = rules.AddSuccessRule("http://wpad/wpad.dat");
288 EXPECT_EQ(rule.text(), resolver.script_data()->utf16());
302 Rules::Rule rule = rules.AddSuccessRule("http://custom/proxy.pac");
307 EXPECT_EQ(rule.text(), resolver.script_data()->utf16());
322 Rules::Rule rule = rules.AddSuccessRule("http://custom/proxy.pac");
331 EXPECT_EQ(rule.text(), resolver.script_data()->utf16());
424 Rules::Rule rule = rules.AddSuccessRule("http://custom/proxy.pac");
429 EXPECT_EQ(rule.url, resolver.script_data()->url());