Bug 1151746 - Origin tuples in should include schemes. r=edwin

This commit is contained in:
JW Wang 2015-04-07 01:32:00 -04:00
Родитель 254ea5d7ad
Коммит ff0f2f0b39
1 изменённых файлов: 45 добавлений и 45 удалений

Просмотреть файл

@ -565,8 +565,8 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
EXPECT_TRUE(IsGMPStorageIsEmpty()); EXPECT_TRUE(IsGMPStorageIsEmpty());
const nsString origin1 = NS_LITERAL_STRING("example1.com"); const nsString origin1 = NS_LITERAL_STRING("http://example1.com");
const nsString origin2 = NS_LITERAL_STRING("example2.org"); const nsString origin2 = NS_LITERAL_STRING("http://example2.org");
nsCString PBnodeId1 = GetNodeId(origin1, origin2, true); nsCString PBnodeId1 = GetNodeId(origin1, origin2, true);
nsCString PBnodeId2 = GetNodeId(origin1, origin2, true); nsCString PBnodeId2 = GetNodeId(origin1, origin2, true);
@ -602,8 +602,8 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
// Once we clear storage, the node ids generated for the same origin-pair // Once we clear storage, the node ids generated for the same origin-pair
// should be different. // should be different.
const nsString origin1 = NS_LITERAL_STRING("example1.com"); const nsString origin1 = NS_LITERAL_STRING("http://example1.com");
const nsString origin2 = NS_LITERAL_STRING("example2.org"); const nsString origin2 = NS_LITERAL_STRING("http://example2.org");
nsCString nodeId3 = GetNodeId(origin1, origin2, false); nsCString nodeId3 = GetNodeId(origin1, origin2, false);
EXPECT_TRUE(!aNodeId1.Equals(nodeId3)); EXPECT_TRUE(!aNodeId1.Equals(nodeId3));
@ -707,8 +707,8 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
Expect(NS_LITERAL_CSTRING("test-storage complete"), Expect(NS_LITERAL_CSTRING("test-storage complete"),
NS_NewRunnableMethod(this, &GMPStorageTest::SetFinished)); NS_NewRunnableMethod(this, &GMPStorageTest::SetFinished));
CreateDecryptor(NS_LITERAL_STRING("example1.com"), CreateDecryptor(NS_LITERAL_STRING("http://example1.com"),
NS_LITERAL_STRING("example2.com"), NS_LITERAL_STRING("http://example2.com"),
false, false,
NS_LITERAL_CSTRING("test-storage")); NS_LITERAL_CSTRING("test-storage"));
} }
@ -728,8 +728,8 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
this, &GMPStorageTest::TestForgetThisSite_AnotherSite); this, &GMPStorageTest::TestForgetThisSite_AnotherSite);
Expect(NS_LITERAL_CSTRING("test-storage complete"), r); Expect(NS_LITERAL_CSTRING("test-storage complete"), r);
CreateDecryptor(NS_LITERAL_STRING("example1.com"), CreateDecryptor(NS_LITERAL_STRING("http://example1.com"),
NS_LITERAL_STRING("example2.com"), NS_LITERAL_STRING("http://example2.com"),
false, false,
NS_LITERAL_CSTRING("test-storage")); NS_LITERAL_CSTRING("test-storage"));
} }
@ -742,8 +742,8 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
this, &GMPStorageTest::TestForgetThisSite_CollectSiteInfo); this, &GMPStorageTest::TestForgetThisSite_CollectSiteInfo);
Expect(NS_LITERAL_CSTRING("test-storage complete"), r); Expect(NS_LITERAL_CSTRING("test-storage complete"), r);
CreateDecryptor(NS_LITERAL_STRING("example3.com"), CreateDecryptor(NS_LITERAL_STRING("http://example3.com"),
NS_LITERAL_STRING("example4.com"), NS_LITERAL_STRING("http://example4.com"),
false, false,
NS_LITERAL_CSTRING("test-storage")); NS_LITERAL_CSTRING("test-storage"));
} }
@ -771,7 +771,7 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
void TestForgetThisSite_CollectSiteInfo() { void TestForgetThisSite_CollectSiteInfo() {
nsAutoPtr<NodeInfo> siteInfo( nsAutoPtr<NodeInfo> siteInfo(
new NodeInfo(NS_LITERAL_CSTRING("example1.com"))); new NodeInfo(NS_LITERAL_CSTRING("http://example1.com")));
// Collect nodeIds that are expected to remain for later comparison. // Collect nodeIds that are expected to remain for later comparison.
EnumerateGMPStorageDir(NS_LITERAL_CSTRING("id"), NodeIdCollector(siteInfo)); EnumerateGMPStorageDir(NS_LITERAL_CSTRING("id"), NodeIdCollector(siteInfo));
// Invoke "Forget this site" on the main thread. // Invoke "Forget this site" on the main thread.
@ -861,8 +861,8 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
this, &GMPStorageTest::TestClearRecentHistory1_Clear); this, &GMPStorageTest::TestClearRecentHistory1_Clear);
Expect(NS_LITERAL_CSTRING("test-storage complete"), r); Expect(NS_LITERAL_CSTRING("test-storage complete"), r);
CreateDecryptor(NS_LITERAL_STRING("example1.com"), CreateDecryptor(NS_LITERAL_STRING("http://example1.com"),
NS_LITERAL_STRING("example2.com"), NS_LITERAL_STRING("http://example2.com"),
false, false,
NS_LITERAL_CSTRING("test-storage")); NS_LITERAL_CSTRING("test-storage"));
} }
@ -883,8 +883,8 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
this, &GMPStorageTest::TestClearRecentHistory2_Clear); this, &GMPStorageTest::TestClearRecentHistory2_Clear);
Expect(NS_LITERAL_CSTRING("test-storage complete"), r); Expect(NS_LITERAL_CSTRING("test-storage complete"), r);
CreateDecryptor(NS_LITERAL_STRING("example1.com"), CreateDecryptor(NS_LITERAL_STRING("http://example1.com"),
NS_LITERAL_STRING("example2.com"), NS_LITERAL_STRING("http://example2.com"),
false, false,
NS_LITERAL_CSTRING("test-storage")); NS_LITERAL_CSTRING("test-storage"));
} }
@ -905,8 +905,8 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
this, &GMPStorageTest::TestClearRecentHistory3_Clear); this, &GMPStorageTest::TestClearRecentHistory3_Clear);
Expect(NS_LITERAL_CSTRING("test-storage complete"), r); Expect(NS_LITERAL_CSTRING("test-storage complete"), r);
CreateDecryptor(NS_LITERAL_STRING("example1.com"), CreateDecryptor(NS_LITERAL_STRING("http://example1.com"),
NS_LITERAL_STRING("example2.com"), NS_LITERAL_STRING("http://example2.com"),
false, false,
NS_LITERAL_CSTRING("test-storage")); NS_LITERAL_CSTRING("test-storage"));
} }
@ -1019,8 +1019,8 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
// Open decryptor on one, origin, write a record, and test that that // Open decryptor on one, origin, write a record, and test that that
// record can't be read on another origin. // record can't be read on another origin.
CreateDecryptor(NS_LITERAL_STRING("example3.com"), CreateDecryptor(NS_LITERAL_STRING("http://example3.com"),
NS_LITERAL_STRING("example4.com"), NS_LITERAL_STRING("http://example4.com"),
false, false,
update); update);
} }
@ -1033,8 +1033,8 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
Expect(NS_LITERAL_CSTRING("retrieve crossOriginTestRecordId succeeded (length 0 bytes)"), Expect(NS_LITERAL_CSTRING("retrieve crossOriginTestRecordId succeeded (length 0 bytes)"),
NS_NewRunnableMethod(this, &GMPStorageTest::SetFinished)); NS_NewRunnableMethod(this, &GMPStorageTest::SetFinished));
CreateDecryptor(NS_LITERAL_STRING("example5.com"), CreateDecryptor(NS_LITERAL_STRING("http://example5.com"),
NS_LITERAL_STRING("example6.com"), NS_LITERAL_STRING("http://example6.com"),
false, false,
NS_LITERAL_CSTRING("retrieve crossOriginTestRecordId")); NS_LITERAL_CSTRING("retrieve crossOriginTestRecordId"));
} }
@ -1050,8 +1050,8 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
// open another, and test that record can be read, close decryptor, // open another, and test that record can be read, close decryptor,
// then send pb-last-context-closed notification, then open decryptor // then send pb-last-context-closed notification, then open decryptor
// and check that it can't read that data; it should have been purged. // and check that it can't read that data; it should have been purged.
CreateDecryptor(NS_LITERAL_STRING("pb1.com"), CreateDecryptor(NS_LITERAL_STRING("http://pb1.com"),
NS_LITERAL_STRING("pb2.com"), NS_LITERAL_STRING("http://pb2.com"),
true, true,
NS_LITERAL_CSTRING("store pbdata test-pb-data")); NS_LITERAL_CSTRING("store pbdata test-pb-data"));
} }
@ -1063,8 +1063,8 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
NS_NewRunnableMethod(this, NS_NewRunnableMethod(this,
&GMPStorageTest::TestPBStorage_RecordRetrievedContinuation)); &GMPStorageTest::TestPBStorage_RecordRetrievedContinuation));
CreateDecryptor(NS_LITERAL_STRING("pb1.com"), CreateDecryptor(NS_LITERAL_STRING("http://pb1.com"),
NS_LITERAL_STRING("pb2.com"), NS_LITERAL_STRING("http://pb2.com"),
true, true,
NS_LITERAL_CSTRING("retrieve pbdata")); NS_LITERAL_CSTRING("retrieve pbdata"));
} }
@ -1077,8 +1077,8 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
NS_NewRunnableMethod(this, NS_NewRunnableMethod(this,
&GMPStorageTest::SetFinished)); &GMPStorageTest::SetFinished));
CreateDecryptor(NS_LITERAL_STRING("pb1.com"), CreateDecryptor(NS_LITERAL_STRING("http://pb1.com"),
NS_LITERAL_STRING("pb2.com"), NS_LITERAL_STRING("http://pb2.com"),
true, true,
NS_LITERAL_CSTRING("retrieve pbdata")); NS_LITERAL_CSTRING("retrieve pbdata"));
} }
@ -1108,20 +1108,20 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
void TestAsyncShutdownTimeout() { void TestAsyncShutdownTimeout() {
// Create decryptors that timeout in their async shutdown. // Create decryptors that timeout in their async shutdown.
// If the gtest hangs on shutdown, test fails! // If the gtest hangs on shutdown, test fails!
CreateAsyncShutdownTimeoutGMP(NS_LITERAL_STRING("example7.com"), CreateAsyncShutdownTimeoutGMP(NS_LITERAL_STRING("http://example7.com"),
NS_LITERAL_STRING("example8.com"), NS_LITERAL_STRING("http://example8.com"),
&GMPStorageTest::TestAsyncShutdownTimeout2); &GMPStorageTest::TestAsyncShutdownTimeout2);
}; };
void TestAsyncShutdownTimeout2() { void TestAsyncShutdownTimeout2() {
CreateAsyncShutdownTimeoutGMP(NS_LITERAL_STRING("example9.com"), CreateAsyncShutdownTimeoutGMP(NS_LITERAL_STRING("http://example9.com"),
NS_LITERAL_STRING("example10.com"), NS_LITERAL_STRING("http://example10.com"),
&GMPStorageTest::TestAsyncShutdownTimeout3); &GMPStorageTest::TestAsyncShutdownTimeout3);
}; };
void TestAsyncShutdownTimeout3() { void TestAsyncShutdownTimeout3() {
CreateAsyncShutdownTimeoutGMP(NS_LITERAL_STRING("example11.com"), CreateAsyncShutdownTimeoutGMP(NS_LITERAL_STRING("http://example11.com"),
NS_LITERAL_STRING("example12.com"), NS_LITERAL_STRING("http://example12.com"),
&GMPStorageTest::SetFinished); &GMPStorageTest::SetFinished);
}; };
@ -1144,8 +1144,8 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
// Test that a GMP can write to storage during shutdown, and retrieve // Test that a GMP can write to storage during shutdown, and retrieve
// that written data in a subsequent session. // that written data in a subsequent session.
CreateDecryptor(NS_LITERAL_STRING("example13.com"), CreateDecryptor(NS_LITERAL_STRING("http://example13.com"),
NS_LITERAL_STRING("example14.com"), NS_LITERAL_STRING("http://example14.com"),
false, false,
update); update);
} }
@ -1163,8 +1163,8 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
Expect(response, Expect(response,
NS_NewRunnableMethod(this, &GMPStorageTest::SetFinished)); NS_NewRunnableMethod(this, &GMPStorageTest::SetFinished));
CreateDecryptor(NS_LITERAL_STRING("example13.com"), CreateDecryptor(NS_LITERAL_STRING("http://example13.com"),
NS_LITERAL_STRING("example14.com"), NS_LITERAL_STRING("http://example14.com"),
false, false,
NS_LITERAL_CSTRING("retrieve-shutdown-token")); NS_LITERAL_CSTRING("retrieve-shutdown-token"));
} }
@ -1176,8 +1176,8 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
Expect(NS_LITERAL_CSTRING("OP tests completed"), Expect(NS_LITERAL_CSTRING("OP tests completed"),
NS_NewRunnableMethod(this, &GMPStorageTest::SetFinished)); NS_NewRunnableMethod(this, &GMPStorageTest::SetFinished));
CreateDecryptor(NS_LITERAL_STRING("example15.com"), CreateDecryptor(NS_LITERAL_STRING("http://example15.com"),
NS_LITERAL_STRING("example16.com"), NS_LITERAL_STRING("http://example16.com"),
false, false,
NS_LITERAL_CSTRING("test-op-apis")); NS_LITERAL_CSTRING("test-op-apis"));
} }
@ -1187,8 +1187,8 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
Expect(NS_LITERAL_CSTRING("retrieved plugin-voucher: gmp-fake placeholder voucher"), Expect(NS_LITERAL_CSTRING("retrieved plugin-voucher: gmp-fake placeholder voucher"),
NS_NewRunnableMethod(this, &GMPStorageTest::SetFinished)); NS_NewRunnableMethod(this, &GMPStorageTest::SetFinished));
CreateDecryptor(NS_LITERAL_STRING("example17.com"), CreateDecryptor(NS_LITERAL_STRING("http://example17.com"),
NS_LITERAL_STRING("example18.com"), NS_LITERAL_STRING("http://example18.com"),
false, false,
NS_LITERAL_CSTRING("retrieve-plugin-voucher")); NS_LITERAL_CSTRING("retrieve-plugin-voucher"));
} }
@ -1237,8 +1237,8 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
Expect(response, continuation); Expect(response, continuation);
} }
CreateDecryptor(NS_LITERAL_STRING("foo.com"), CreateDecryptor(NS_LITERAL_STRING("http://foo.com"),
NS_LITERAL_STRING("bar.com"), NS_LITERAL_STRING("http://bar.com"),
aPrivateBrowsing, aPrivateBrowsing,
Move(updates)); Move(updates));
} }
@ -1290,8 +1290,8 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
update.Append(longRecordName); update.Append(longRecordName);
update.AppendLiteral(" "); update.AppendLiteral(" ");
update.Append(data); update.Append(data);
CreateDecryptor(NS_LITERAL_STRING("fuz.com"), CreateDecryptor(NS_LITERAL_STRING("http://fuz.com"),
NS_LITERAL_STRING("baz.com"), NS_LITERAL_STRING("http://baz.com"),
false, false,
update); update);
} }