Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(404)

Side by Side Diff: chrome/common/content_settings_pattern_unittest.cc

Issue 518803009: Move content_settings_pattern and content_settings_pattern_parser to the content_settings component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/common/content_settings_pattern_serializer.cc ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/common/content_settings_pattern_serializer.cc ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698