OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_condit
ion_attribute.h" | 5 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_condit
ion_attribute.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 one_stage_attributes; | 280 one_stage_attributes; |
281 | 281 |
282 for (size_t i = 0; i < arraysize(active_stages); ++i) { | 282 for (size_t i = 0; i < arraysize(active_stages); ++i) { |
283 ListValue single_stage_list; | 283 ListValue single_stage_list; |
284 single_stage_list.AppendString(active_stages[i].second); | 284 single_stage_list.AppendString(active_stages[i].second); |
285 one_stage_attributes.push_back( | 285 one_stage_attributes.push_back( |
286 WebRequestConditionAttribute::Create(keys::kStagesKey, | 286 WebRequestConditionAttribute::Create(keys::kStagesKey, |
287 &single_stage_list, | 287 &single_stage_list, |
288 &error)); | 288 &error)); |
289 EXPECT_EQ("", error); | 289 EXPECT_EQ("", error); |
290 ASSERT_TRUE(one_stage_attributes.back() != NULL); | 290 ASSERT_TRUE(one_stage_attributes.back().get() != NULL); |
291 } | 291 } |
292 | 292 |
293 const GURL url_empty; | 293 const GURL url_empty; |
294 net::TestURLRequestContext context; | 294 net::TestURLRequestContext context; |
295 net::TestDelegate delegate; | 295 net::TestDelegate delegate; |
296 net::TestURLRequest url_request(url_empty, &delegate, &context, NULL); | 296 net::TestURLRequest url_request(url_empty, &delegate, &context, NULL); |
297 | 297 |
298 for (size_t i = 0; i < arraysize(active_stages); ++i) { | 298 for (size_t i = 0; i < arraysize(active_stages); ++i) { |
299 EXPECT_FALSE(empty_attribute->IsFulfilled( | 299 EXPECT_FALSE(empty_attribute->IsFulfilled( |
300 WebRequestData(&url_request, active_stages[i].first))); | 300 WebRequestData(&url_request, active_stages[i].first))); |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 keys::kValueEqualsKey, "valueB" | 663 keys::kValueEqualsKey, "valueB" |
664 }; | 664 }; |
665 const size_t kExistingSize[] = { arraysize(kExisting) }; | 665 const size_t kExistingSize[] = { arraysize(kExisting) }; |
666 GetArrayAsVector(kExisting, kExistingSize, 1u, &tests); | 666 GetArrayAsVector(kExisting, kExistingSize, 1u, &tests); |
667 MatchAndCheck( | 667 MatchAndCheck( |
668 tests, keys::kExcludeResponseHeadersKey, stage, &url_request, &result); | 668 tests, keys::kExcludeResponseHeadersKey, stage, &url_request, &result); |
669 EXPECT_FALSE(result); | 669 EXPECT_FALSE(result); |
670 } | 670 } |
671 | 671 |
672 } // namespace extensions | 672 } // namespace extensions |
OLD | NEW |