OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/content_settings/content_settings_utils.h" | 5 #include "chrome/browser/content_settings/content_settings_utils.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
| 9 #include "chrome/common/content_settings_component.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
10 | 11 |
11 TEST(ContentSettingsUtilsTest, ParsePatternString) { | 12 TEST(ContentSettingsUtilsTest, ParsePatternString) { |
| 13 InitContentSettingsComponent(); |
12 content_settings::PatternPair pattern_pair; | 14 content_settings::PatternPair pattern_pair; |
13 | 15 |
14 pattern_pair = content_settings::ParsePatternString(std::string()); | 16 pattern_pair = content_settings::ParsePatternString(std::string()); |
15 EXPECT_FALSE(pattern_pair.first.IsValid()); | 17 EXPECT_FALSE(pattern_pair.first.IsValid()); |
16 EXPECT_FALSE(pattern_pair.second.IsValid()); | 18 EXPECT_FALSE(pattern_pair.second.IsValid()); |
17 | 19 |
18 pattern_pair = content_settings::ParsePatternString(","); | 20 pattern_pair = content_settings::ParsePatternString(","); |
19 EXPECT_FALSE(pattern_pair.first.IsValid()); | 21 EXPECT_FALSE(pattern_pair.first.IsValid()); |
20 EXPECT_FALSE(pattern_pair.second.IsValid()); | 22 EXPECT_FALSE(pattern_pair.second.IsValid()); |
21 | 23 |
(...skipping 14 matching lines...) Expand all Loading... |
36 pattern_pair = content_settings::ParsePatternString( | 38 pattern_pair = content_settings::ParsePatternString( |
37 "http://www.foo.com,http://www.bar.com,"); | 39 "http://www.foo.com,http://www.bar.com,"); |
38 EXPECT_FALSE(pattern_pair.first.IsValid()); | 40 EXPECT_FALSE(pattern_pair.first.IsValid()); |
39 EXPECT_FALSE(pattern_pair.second.IsValid()); | 41 EXPECT_FALSE(pattern_pair.second.IsValid()); |
40 | 42 |
41 pattern_pair = content_settings::ParsePatternString( | 43 pattern_pair = content_settings::ParsePatternString( |
42 "http://www.foo.com,http://www.bar.com,http://www.error.com"); | 44 "http://www.foo.com,http://www.bar.com,http://www.error.com"); |
43 EXPECT_FALSE(pattern_pair.first.IsValid()); | 45 EXPECT_FALSE(pattern_pair.first.IsValid()); |
44 EXPECT_FALSE(pattern_pair.second.IsValid()); | 46 EXPECT_FALSE(pattern_pair.second.IsValid()); |
45 } | 47 } |
OLD | NEW |