Update IPFS ports in tests

This commit is contained in:
Jocelyn Liu
2020-10-13 09:21:36 -07:00
parent d17061446d
commit 14aa3c7d25
8 changed files with 30 additions and 28 deletions
@@ -49,7 +49,7 @@ const GURL& GetIPFSGatewayURL() {
const GURL& GetIPFSLocalURL() {
static const GURL ipfs_url(
"http://127.0.0.1:8080/ipfs/"
"http://127.0.0.1:48080/ipfs/"
"bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/wiki/"
"Vincent_van_Gogh.html"); // NOLINT
return ipfs_url;
@@ -35,8 +35,8 @@ TEST(IPFSRedirectNetworkDelegateHelperTest, TranslateIPFSURIIPFSSchemeLocal) {
brave_request_info);
EXPECT_EQ(rc, net::OK);
EXPECT_EQ(brave_request_info->new_url_spec,
"http://127.0.0.1:8080/ipfs/"
"QmfM2r8seH2GiRaC4esTjeraXEachRt8ZsSeGaWTPLyMoG");
"http://127.0.0.1:48080/ipfs/"
"QmfM2r8seH2GiRaC4esTjeraXEachRt8ZsSeGaWTPLyMoG");
}
TEST(IPFSRedirectNetworkDelegateHelperTest, TranslateIPFSURIIPFSScheme) {
@@ -46,7 +46,8 @@ TEST(IPFSRedirectNetworkDelegateHelperTest, TranslateIPFSURIIPFSScheme) {
int rc = ipfs::OnBeforeURLRequest_IPFSRedirectWork(brave::ResponseCallback(),
brave_request_info);
EXPECT_EQ(rc, net::OK);
EXPECT_EQ(brave_request_info->new_url_spec,
EXPECT_EQ(
brave_request_info->new_url_spec,
"https://dweb.link/ipfs/QmfM2r8seH2GiRaC4esTjeraXEachRt8ZsSeGaWTPLyMoG");
}
@@ -58,8 +59,8 @@ TEST(IPFSRedirectNetworkDelegateHelperTest, TranslateIPFSURIIPNSSchemeLocal) {
brave_request_info);
EXPECT_EQ(rc, net::OK);
EXPECT_EQ(brave_request_info->new_url_spec,
"http://127.0.0.1:8080/ipns/"
"QmSrPmbaUKA3ZodhzPWZnpFgcPMFWF4QsxXbkWfEptTBJd");
"http://127.0.0.1:48080/ipns/"
"QmSrPmbaUKA3ZodhzPWZnpFgcPMFWF4QsxXbkWfEptTBJd");
}
TEST(IPFSRedirectNetworkDelegateHelperTest, TranslateIPFSURIIPNSScheme) {
@@ -69,7 +70,8 @@ TEST(IPFSRedirectNetworkDelegateHelperTest, TranslateIPFSURIIPNSScheme) {
int rc = ipfs::OnBeforeURLRequest_IPFSRedirectWork(brave::ResponseCallback(),
brave_request_info);
EXPECT_EQ(rc, net::OK);
EXPECT_EQ(brave_request_info->new_url_spec,
EXPECT_EQ(
brave_request_info->new_url_spec,
"https://dweb.link/ipns/QmSrPmbaUKA3ZodhzPWZnpFgcPMFWF4QsxXbkWfEptTBJd");
}
+4 -4
View File
@@ -49,9 +49,9 @@ TEST_F(IPFSJSONParserTest, GetAddressesConfigFromJSON) {
"Key": "Addresses",
"Value":
{
"API": "/ip4/127.0.0.1/tcp/5001",
"API": "/ip4/127.0.0.1/tcp/45001",
"Announce": [],
"Gateway": "/ip4/127.0.0.1/tcp/8080",
"Gateway": "/ip4/127.0.0.1/tcp/48080",
"NoAnnounce": [],
"Swarm": [
"/ip4/0.0.0.0/tcp/4001",
@@ -63,8 +63,8 @@ TEST_F(IPFSJSONParserTest, GetAddressesConfigFromJSON) {
})",
&config));
ASSERT_EQ(config.api, "/ip4/127.0.0.1/tcp/5001");
ASSERT_EQ(config.gateway, "/ip4/127.0.0.1/tcp/8080");
ASSERT_EQ(config.api, "/ip4/127.0.0.1/tcp/45001");
ASSERT_EQ(config.gateway, "/ip4/127.0.0.1/tcp/48080");
ASSERT_EQ(config.swarm,
(std::vector<std::string>{
"/ip4/0.0.0.0/tcp/4001", "/ip6/::/tcp/4001",
@@ -89,7 +89,7 @@ class IpfsNavigationThrottleBrowserTest : public InProcessBrowserTest {
ipfs_service_->SetIpfsLaunchedForTest(true);
ipfs_url_ = GURL(
"http://127.0.0.1:8080/ipfs/"
"http://127.0.0.1:48080/ipfs/"
"QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR");
gateway_url_ = GURL(
"https://dweb.link/ipfs/"
@@ -38,7 +38,7 @@ namespace {
const GURL& GetIPFSURL() {
static const GURL ipfs_url(
"http://localhost:8080/ipfs/"
"http://localhost:48080/ipfs/"
"bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/wiki/"
"Vincent_van_Gogh.html"); // NOLINT
return ipfs_url;
@@ -46,7 +46,7 @@ const GURL& GetIPFSURL() {
const GURL& GetIPNSURL() {
static const GURL ipns_url(
"http://localhost:8080/ipns/tr.wikipedia-on-ipfs.org/wiki/"
"http://localhost:48080/ipns/tr.wikipedia-on-ipfs.org/wiki/"
"Anasayfa.html"); // NOLINT
return ipns_url;
}
+4 -4
View File
@@ -92,9 +92,9 @@ class IpfsServiceBrowserTest : public InProcessBrowserTest {
"Key": "Addresses",
"Value":
{
"API": "/ip4/127.0.0.1/tcp/5001",
"API": "/ip4/127.0.0.1/tcp/45001",
"Announce": [],
"Gateway": "/ip4/127.0.0.1/tcp/8080",
"Gateway": "/ip4/127.0.0.1/tcp/48080",
"NoAnnounce": [],
"Swarm": [
"/ip4/0.0.0.0/tcp/4001",
@@ -160,8 +160,8 @@ class IpfsServiceBrowserTest : public InProcessBrowserTest {
wait_for_request_->Quit();
}
EXPECT_TRUE(success);
EXPECT_EQ(config.api, "/ip4/127.0.0.1/tcp/5001");
EXPECT_EQ(config.gateway, "/ip4/127.0.0.1/tcp/8080");
EXPECT_EQ(config.api, "/ip4/127.0.0.1/tcp/45001");
EXPECT_EQ(config.gateway, "/ip4/127.0.0.1/tcp/48080");
EXPECT_EQ(config.swarm, GetExpectedSwarm());
}
+8 -8
View File
@@ -14,10 +14,10 @@ typedef testing::Test IpfsUtilsUnitTest;
TEST_F(IpfsUtilsUnitTest, IsIPFSURL) {
std::vector<GURL> ipfs_urls(
{GURL("http://localhost:8080/ipfs/"
{GURL("http://localhost:48080/ipfs/"
"bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/wiki/"
"Vincent_van_Gogh.html"),
GURL("http://localhost:8080/ipns/tr.wikipedia-on-ipfs.org/wiki/"
GURL("http://localhost:48080/ipns/tr.wikipedia-on-ipfs.org/wiki/"
"Anasayfa.html")});
for (auto url : ipfs_urls) {
@@ -34,10 +34,10 @@ TEST_F(IpfsUtilsUnitTest, IsDefaultGatewayURL) {
"Anasayfa.html")});
std::vector<GURL> ipfs_urls(
{GURL("http://localhost:8080/ipfs/"
{GURL("http://localhost:48080/ipfs/"
"bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/wiki/"
"Vincent_van_Gogh.html"),
GURL("http://localhost:8080/ipns/tr.wikipedia-on-ipfs.org/wiki/"
GURL("http://localhost:48080/ipns/tr.wikipedia-on-ipfs.org/wiki/"
"Anasayfa.html"),
GURL("ipfs://bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq"
"/wiki/Vincent_van_Gogh.html")});
@@ -53,10 +53,10 @@ TEST_F(IpfsUtilsUnitTest, IsDefaultGatewayURL) {
TEST_F(IpfsUtilsUnitTest, IsLocalGatewayURL) {
std::vector<GURL> local_gateway_urls(
{GURL("http://localhost:8080/ipfs/"
{GURL("http://localhost:48080/ipfs/"
"bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/wiki/"
"Vincent_van_Gogh.html"),
GURL("http://127.0.0.1:8080/ipfs/"
GURL("http://127.0.0.1:48080/ipfs/"
"bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/wiki/"
"Vincent_van_Gogh.html")});
@@ -84,10 +84,10 @@ TEST_F(IpfsUtilsUnitTest, IsLocalGatewayURL) {
TEST_F(IpfsUtilsUnitTest, ToPublicGatewayURL) {
std::vector<GURL> ipfs_urls(
{GURL("http://localhost:8080/ipfs/"
{GURL("http://localhost:48080/ipfs/"
"bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/wiki/"
"Vincent_van_Gogh.html"),
GURL("http://127.0.0.1:8080/ipfs/"
GURL("http://127.0.0.1:48080/ipfs/"
"bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/wiki/"
"Vincent_van_Gogh.html"),
GURL("ipfs://bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq"
@@ -53,7 +53,7 @@ TEST_F(IPFSBraveContentBrowserClientTest, TranslateIPFSURIIPFSSchemeLocal) {
GURL url("ipfs://QmfM2r8seH2GiRaC4esTjeraXEachRt8ZsSeGaWTPLyMoG");
GURL new_url;
ASSERT_TRUE(ipfs::TranslateIPFSURI(url, &new_url, true));
EXPECT_EQ(new_url, GURL("http://127.0.0.1:8080/ipfs/"
EXPECT_EQ(new_url, GURL("http://127.0.0.1:48080/ipfs/"
"QmfM2r8seH2GiRaC4esTjeraXEachRt8ZsSeGaWTPLyMoG"));
}
@@ -61,7 +61,7 @@ TEST_F(IPFSBraveContentBrowserClientTest, TranslateIPFSURIIPNSSchemeLocal) {
GURL url("ipns://QmSrPmbaUKA3ZodhzPWZnpFgcPMFWF4QsxXbkWfEptTBJd");
GURL new_url;
ASSERT_TRUE(ipfs::TranslateIPFSURI(url, &new_url, true));
EXPECT_EQ(new_url, GURL("http://127.0.0.1:8080/ipns/"
EXPECT_EQ(new_url, GURL("http://127.0.0.1:48080/ipns/"
"QmSrPmbaUKA3ZodhzPWZnpFgcPMFWF4QsxXbkWfEptTBJd"));
}