| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/url_matcher/url_matcher_factory.h" | 5 #include "components/url_matcher/url_matcher_factory.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 // Valid values: | 41 // Valid values: |
| 42 // { | 42 // { |
| 43 // "port_range": [80, [1000, 1010]], | 43 // "port_range": [80, [1000, 1010]], |
| 44 // "schemes": ["http"], | 44 // "schemes": ["http"], |
| 45 // "hostSuffix": "example.com" | 45 // "hostSuffix": "example.com" |
| 46 // "hostPrefix": "www" | 46 // "hostPrefix": "www" |
| 47 // } | 47 // } |
| 48 | 48 |
| 49 // Port range: Allow 80;1000-1010. | 49 // Port range: Allow 80;1000-1010. |
| 50 base::ListValue* port_range = new base::ListValue(); | 50 base::ListValue* port_range = new base::ListValue(); |
| 51 port_range->Append(base::Value::CreateIntegerValue(1000)); | 51 port_range->Append(new base::FundamentalValue(1000)); |
| 52 port_range->Append(base::Value::CreateIntegerValue(1010)); | 52 port_range->Append(new base::FundamentalValue(1010)); |
| 53 base::ListValue* port_ranges = new base::ListValue(); | 53 base::ListValue* port_ranges = new base::ListValue(); |
| 54 port_ranges->Append(base::Value::CreateIntegerValue(80)); | 54 port_ranges->Append(new base::FundamentalValue(80)); |
| 55 port_ranges->Append(port_range); | 55 port_ranges->Append(port_range); |
| 56 | 56 |
| 57 base::ListValue* scheme_list = new base::ListValue(); | 57 base::ListValue* scheme_list = new base::ListValue(); |
| 58 scheme_list->Append(base::Value::CreateStringValue("http")); | 58 scheme_list->Append(base::Value::CreateStringValue("http")); |
| 59 | 59 |
| 60 base::DictionaryValue valid_condition; | 60 base::DictionaryValue valid_condition; |
| 61 valid_condition.SetString(keys::kHostSuffixKey, "example.com"); | 61 valid_condition.SetString(keys::kHostSuffixKey, "example.com"); |
| 62 valid_condition.SetString(keys::kHostPrefixKey, "www"); | 62 valid_condition.SetString(keys::kHostPrefixKey, "www"); |
| 63 valid_condition.Set(keys::kPortsKey, port_ranges); | 63 valid_condition.Set(keys::kPortsKey, port_ranges); |
| 64 valid_condition.Set(keys::kSchemesKey, scheme_list); | 64 valid_condition.Set(keys::kSchemesKey, scheme_list); |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 kIsUrlCaseSensitive, kIsUrlLowerCaseEnforced, url), | 330 kIsUrlCaseSensitive, kIsUrlLowerCaseEnforced, url), |
| 331 }; | 331 }; |
| 332 | 332 |
| 333 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(case_tests); ++i) { | 333 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(case_tests); ++i) { |
| 334 SCOPED_TRACE(base::StringPrintf("Iteration: %" PRIuS, i)); | 334 SCOPED_TRACE(base::StringPrintf("Iteration: %" PRIuS, i)); |
| 335 case_tests[i].Test(); | 335 case_tests[i].Test(); |
| 336 } | 336 } |
| 337 } | 337 } |
| 338 | 338 |
| 339 } // namespace url_matcher | 339 } // namespace url_matcher |
| OLD | NEW |