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

Unified Diff: chrome/common/extensions/extension_unittest.cc

Issue 5642001: Fix issue that causes some extensions to be disabled right after installation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/extension_unittest.cc
diff --git a/chrome/common/extensions/extension_unittest.cc b/chrome/common/extensions/extension_unittest.cc
index 07bd6c6fc3aa707735d52f1f1d675793a068b319..ecc1d4ae4050a3aac689cc5459936938add7025b 100644
--- a/chrome/common/extensions/extension_unittest.cc
+++ b/chrome/common/extensions/extension_unittest.cc
@@ -1105,9 +1105,13 @@ TEST(ExtensionTest, ApiPermissions) {
TEST(ExtensionTest, GetDistinctHosts) {
std::vector<std::string> expected;
+ std::vector<std::string> expected_no_rcd;
expected.push_back("www.foo.com");
expected.push_back("www.bar.com");
expected.push_back("www.baz.com");
+ expected_no_rcd.push_back("www.foo.");
+ expected_no_rcd.push_back("www.bar.");
+ expected_no_rcd.push_back("www.baz.");
URLPatternList actual;
{
@@ -1121,7 +1125,9 @@ TEST(ExtensionTest, GetDistinctHosts) {
actual.push_back(
URLPattern(URLPattern::SCHEME_HTTP, "http://www.baz.com/path"));
CompareLists(expected,
- Extension::GetDistinctHosts(actual));
+ Extension::GetDistinctHosts(actual, true));
+ CompareLists(expected_no_rcd,
+ Extension::GetDistinctHosts(actual, false));
}
{
@@ -1133,7 +1139,9 @@ TEST(ExtensionTest, GetDistinctHosts) {
actual.push_back(
URLPattern(URLPattern::SCHEME_HTTP, "http://www.baz.com/path"));
CompareLists(expected,
- Extension::GetDistinctHosts(actual));
+ Extension::GetDistinctHosts(actual, true));
+ CompareLists(expected_no_rcd,
+ Extension::GetDistinctHosts(actual, false));
}
{
@@ -1143,7 +1151,9 @@ TEST(ExtensionTest, GetDistinctHosts) {
actual.push_back(
URLPattern(URLPattern::SCHEME_HTTPS, "https://www.bar.com/path"));
CompareLists(expected,
- Extension::GetDistinctHosts(actual));
+ Extension::GetDistinctHosts(actual, true));
+ CompareLists(expected_no_rcd,
+ Extension::GetDistinctHosts(actual, false));
}
{
@@ -1153,7 +1163,9 @@ TEST(ExtensionTest, GetDistinctHosts) {
actual.push_back(
URLPattern(URLPattern::SCHEME_HTTP, "http://www.bar.com/pathypath"));
CompareLists(expected,
- Extension::GetDistinctHosts(actual));
+ Extension::GetDistinctHosts(actual, true));
+ CompareLists(expected_no_rcd,
+ Extension::GetDistinctHosts(actual, false));
}
{
@@ -1167,9 +1179,14 @@ TEST(ExtensionTest, GetDistinctHosts) {
expected.push_back("monkey.www.bar.com");
expected.push_back("bar.com");
+ expected_no_rcd.push_back("monkey.www.bar.");
+ expected_no_rcd.push_back("bar.");
+
CompareLists(expected,
- Extension::GetDistinctHosts(actual));
+ Extension::GetDistinctHosts(actual, true));
+ CompareLists(expected_no_rcd,
+ Extension::GetDistinctHosts(actual, false));
}
{
@@ -1194,9 +1211,12 @@ TEST(ExtensionTest, GetDistinctHosts) {
URLPattern(URLPattern::SCHEME_HTTP, "http://www.foo.xyzzy/path"));
expected.push_back("www.foo.xyzzy");
+ expected_no_rcd.push_back("www.foo.xyzzy");
CompareLists(expected,
- Extension::GetDistinctHosts(actual));
+ Extension::GetDistinctHosts(actual, true));
+ CompareLists(expected_no_rcd,
+ Extension::GetDistinctHosts(actual, false));
}
}

Powered by Google App Engine
This is Rietveld 408576698