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_pattern.h" | 5 #include "chrome/common/content_settings_pattern.h" |
6 | 6 |
7 #include "googleurl/src/gurl.h" | 7 #include "googleurl/src/gurl.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 // file:/// normalization. | 573 // file:/// normalization. |
574 EXPECT_STREQ("file:///tmp/test.html", | 574 EXPECT_STREQ("file:///tmp/test.html", |
575 Pattern("file:///tmp/bar/../test.html").ToString().c_str()); | 575 Pattern("file:///tmp/bar/../test.html").ToString().c_str()); |
576 | 576 |
577 // Invalid patterns. | 577 // Invalid patterns. |
578 EXPECT_STREQ("", Pattern("*example.com").ToString().c_str()); | 578 EXPECT_STREQ("", Pattern("*example.com").ToString().c_str()); |
579 EXPECT_STREQ("", Pattern("example.*").ToString().c_str()); | 579 EXPECT_STREQ("", Pattern("example.*").ToString().c_str()); |
580 EXPECT_STREQ("", Pattern("*\xC4\x87ira.com").ToString().c_str()); | 580 EXPECT_STREQ("", Pattern("*\xC4\x87ira.com").ToString().c_str()); |
581 EXPECT_STREQ("", Pattern("\xC4\x87ira.*").ToString().c_str()); | 581 EXPECT_STREQ("", Pattern("\xC4\x87ira.*").ToString().c_str()); |
582 } | 582 } |
OLD | NEW |