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/common/content_settings_pattern.h" | 5 #include "components/content_settings/core/common/content_settings_pattern.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "url/gurl.h" | 8 #include "url/gurl.h" |
9 | 9 |
10 namespace { | 10 namespace { |
11 | 11 |
12 ContentSettingsPattern Pattern(const std::string& str) { | 12 ContentSettingsPattern Pattern(const std::string& str) { |
13 return ContentSettingsPattern::FromString(str); | 13 return ContentSettingsPattern::FromString(str); |
14 } | 14 } |
15 | 15 |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 // file:/// normalization. | 663 // file:/// normalization. |
664 EXPECT_STREQ("file:///tmp/test.html", | 664 EXPECT_STREQ("file:///tmp/test.html", |
665 Pattern("file:///tmp/bar/../test.html").ToString().c_str()); | 665 Pattern("file:///tmp/bar/../test.html").ToString().c_str()); |
666 | 666 |
667 // Invalid patterns. | 667 // Invalid patterns. |
668 EXPECT_STREQ("", Pattern("*example.com").ToString().c_str()); | 668 EXPECT_STREQ("", Pattern("*example.com").ToString().c_str()); |
669 EXPECT_STREQ("", Pattern("example.*").ToString().c_str()); | 669 EXPECT_STREQ("", Pattern("example.*").ToString().c_str()); |
670 EXPECT_STREQ("", Pattern("*\xC4\x87ira.com").ToString().c_str()); | 670 EXPECT_STREQ("", Pattern("*\xC4\x87ira.com").ToString().c_str()); |
671 EXPECT_STREQ("", Pattern("\xC4\x87ira.*").ToString().c_str()); | 671 EXPECT_STREQ("", Pattern("\xC4\x87ira.*").ToString().c_str()); |
672 } | 672 } |
OLD | NEW |