Skip to content

Commit

Permalink
Rename content/test/data/htxg to content/test/data/sxg
Browse files Browse the repository at this point in the history
Bug: 856530
Change-Id: I8da043903712003379603b443ad2c584ebc1c244
Reviewed-on: https://chromium-review.googlesource.com/1131022
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574024}
  • Loading branch information
irori authored and Commit Bot committed Jul 11, 2018
1 parent 5e72208 commit ba39085
Show file tree
Hide file tree
Showing 33 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion WATCHLISTS
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,7 @@
'web_package': {
'filepath': 'content/browser/loader/prefetch_url_loader'\
'|content/browser/web_package/'\
'|content/test/data/htxg/'
'|content/test/data/sxg/'
},
'web_share': {
'filepath': 'chrome/android/java/src/org/chromium/chrome/browser/webshare/'\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ TEST(SignedExchangeCertificateParseB1Test, ParseGoldenFile) {
base::FilePath path;
base::PathService::Get(content::DIR_TEST_DATA, &path);
path =
path.AppendASCII("htxg").AppendASCII("test.example.org.public.pem.cbor");
path.AppendASCII("sxg").AppendASCII("test.example.org.public.pem.cbor");
std::string contents;
ASSERT_TRUE(base::ReadFileToString(path, &contents));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ base::Optional<SignedExchangeEnvelope> GenerateHeaderAndParse(
} // namespace

TEST(SignedExchangeEnvelopeTest, ParseGoldenFile) {
base::FilePath test_htxg_path;
base::PathService::Get(content::DIR_TEST_DATA, &test_htxg_path);
test_htxg_path = test_htxg_path.AppendASCII("htxg").AppendASCII(
base::FilePath test_sxg_path;
base::PathService::Get(content::DIR_TEST_DATA, &test_sxg_path);
test_sxg_path = test_sxg_path.AppendASCII("sxg").AppendASCII(
"test.example.org_test.htxg");

std::string contents;
ASSERT_TRUE(base::ReadFileToString(test_htxg_path, &contents));
ASSERT_TRUE(base::ReadFileToString(test_sxg_path, &contents));
auto* contents_bytes = reinterpret_cast<const uint8_t*>(contents.data());

ASSERT_GT(contents.size(), SignedExchangePrologue::kEncodedPrologueInBytes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ constexpr base::StringPiece kDummySCTList = "SCT";
std::string GetTestFileContents(base::StringPiece name) {
base::FilePath path;
base::PathService::Get(content::DIR_TEST_DATA, &path);
path = path.AppendASCII("htxg").AppendASCII(name);
path = path.AppendASCII("sxg").AppendASCII(name);

std::string contents;
CHECK(base::ReadFileToString(path, &contents));
Expand All @@ -64,7 +64,7 @@ scoped_refptr<net::X509Certificate> LoadCertificate(
const std::string& cert_file) {
base::FilePath dir_path;
base::PathService::Get(content::DIR_TEST_DATA, &dir_path);
dir_path = dir_path.AppendASCII("htxg");
dir_path = dir_path.AppendASCII("sxg");

base::ScopedAllowBlockingForTesting allow_io;
return net::CreateCertificateChainFromFile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class SignedExchangeRequestHandlerBrowserTest : public ContentBrowserTest {
base::ScopedAllowBlockingForTesting allow_io;
base::FilePath dir_path;
base::PathService::Get(content::DIR_TEST_DATA, &dir_path);
dir_path = dir_path.AppendASCII("htxg");
dir_path = dir_path.AppendASCII("sxg");

return net::CreateCertificateChainFromFile(
dir_path, cert_file, net::X509Certificate::FORMAT_PEM_CERT_SEQUENCE);
Expand Down Expand Up @@ -172,7 +172,7 @@ class SignedExchangeRequestHandlerWithNetworkServiceBrowserTest
IN_PROC_BROWSER_TEST_F(SignedExchangeRequestHandlerBrowserTest, Simple) {
InstallUrlInterceptor(
GURL("https://cert.example.org/cert.msg"),
"content/test/data/htxg/test.example.org.public.pem.cbor");
"content/test/data/sxg/test.example.org.public.pem.cbor");

// Make the MockCertVerifier treat the certificate
// "prime256v1-sha256.public.pem" as valid for "test.example.org".
Expand All @@ -188,15 +188,15 @@ IN_PROC_BROWSER_TEST_F(SignedExchangeRequestHandlerBrowserTest, Simple) {

embedded_test_server()->RegisterRequestMonitor(
base::BindRepeating([](const net::test_server::HttpRequest& request) {
if (request.relative_url == "/htxg/test.example.org_test.htxg") {
if (request.relative_url == "/sxg/test.example.org_test.htxg") {
const auto& accept_value = request.headers.find("accept")->second;
EXPECT_THAT(accept_value,
::testing::HasSubstr("application/signed-exchange;v=b1"));
}
}));
embedded_test_server()->ServeFilesFromSourceDirectory("content/test/data");
ASSERT_TRUE(embedded_test_server()->Start());
GURL url = embedded_test_server()->GetURL("/htxg/test.example.org_test.htxg");
GURL url = embedded_test_server()->GetURL("/sxg/test.example.org_test.htxg");
base::string16 title = base::ASCIIToUTF16("https://test.example.org/test/");
TitleWatcher title_watcher(shell()->web_contents(), title);
NavigateToURL(shell(), url);
Expand Down Expand Up @@ -225,7 +225,7 @@ IN_PROC_BROWSER_TEST_F(SignedExchangeRequestHandlerBrowserTest,
InvalidContentType) {
InstallUrlInterceptor(
GURL("https://cert.example.org/cert.msg"),
"content/test/data/htxg/test.example.org.public.pem.cbor");
"content/test/data/sxg/test.example.org.public.pem.cbor");

// Make the MockCertVerifier treat the certificate
// "prime256v1-sha256.public.pem" as valid for "test.example.org".
Expand All @@ -242,7 +242,7 @@ IN_PROC_BROWSER_TEST_F(SignedExchangeRequestHandlerBrowserTest,
embedded_test_server()->ServeFilesFromSourceDirectory("content/test/data");
ASSERT_TRUE(embedded_test_server()->Start());
GURL url = embedded_test_server()->GetURL(
"/htxg/test.example.org_test_invalid_content_type.htxg");
"/sxg/test.example.org_test_invalid_content_type.htxg");

NavigationFailureObserver failure_observer(shell()->web_contents());
NavigateToURL(shell(), url);
Expand All @@ -254,11 +254,11 @@ IN_PROC_BROWSER_TEST_F(SignedExchangeRequestHandlerBrowserTest,

IN_PROC_BROWSER_TEST_F(SignedExchangeRequestHandlerBrowserTest, CertNotFound) {
InstallUrlInterceptor(GURL("https://cert.example.org/cert.msg"),
"content/test/data/htxg/404.msg");
"content/test/data/sxg/404.msg");

embedded_test_server()->ServeFilesFromSourceDirectory("content/test/data");
ASSERT_TRUE(embedded_test_server()->Start());
GURL url = embedded_test_server()->GetURL("/htxg/test.example.org_test.htxg");
GURL url = embedded_test_server()->GetURL("/sxg/test.example.org_test.htxg");

NavigationFailureObserver failure_observer(shell()->web_contents());
NavigateToURL(shell(), url);
Expand All @@ -273,7 +273,7 @@ IN_PROC_BROWSER_TEST_F(
NetworkServiceEnabled) {
InstallUrlInterceptor(
GURL("https://test.example.org/cert.msg"),
"content/test/data/htxg/test.example.org.public.pem.cbor");
"content/test/data/sxg/test.example.org.public.pem.cbor");

// Make the MockCertVerifier treat the certificate
// "prime256v1-sha256.public.pem" as valid for "test.example.org".
Expand All @@ -289,7 +289,7 @@ IN_PROC_BROWSER_TEST_F(

embedded_test_server()->ServeFilesFromSourceDirectory("content/test/data");
ASSERT_TRUE(embedded_test_server()->Start());
GURL url = embedded_test_server()->GetURL("/htxg/test.example.org_test.htxg");
GURL url = embedded_test_server()->GetURL("/sxg/test.example.org_test.htxg");

NavigationFailureObserver failure_observer(shell()->web_contents());
NavigateToURL(shell(), url);
Expand All @@ -303,22 +303,22 @@ IN_PROC_BROWSER_TEST_F(SignedExchangeRequestHandlerBrowserTest,
RealCertVerifier) {
InstallUrlInterceptor(
GURL("https://cert.example.org/cert.msg"),
"content/test/data/htxg/test.example.org.public.pem.cbor");
"content/test/data/sxg/test.example.org.public.pem.cbor");

// Use "real" CertVerifier.
SignedExchangeHandler::SetCertVerifierForTesting(nullptr);

embedded_test_server()->RegisterRequestMonitor(
base::BindRepeating([](const net::test_server::HttpRequest& request) {
if (request.relative_url == "/htxg/test.example.org_test.htxg") {
if (request.relative_url == "/sxg/test.example.org_test.htxg") {
const auto& accept_value = request.headers.find("accept")->second;
EXPECT_THAT(accept_value,
::testing::HasSubstr("application/signed-exchange;v=b1"));
}
}));
embedded_test_server()->ServeFilesFromSourceDirectory("content/test/data");
ASSERT_TRUE(embedded_test_server()->Start());
GURL url = embedded_test_server()->GetURL("/htxg/test.example.org_test.htxg");
GURL url = embedded_test_server()->GetURL("/sxg/test.example.org_test.htxg");

// "test.example.org_test.htxg" should pass CertVerifier::Verify() and then
// fail at SignedExchangeHandler::CheckOCSPStatus() because of the dummy OCSP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ TEST(SignedExchangeSignatureVerifier, EncodeCanonicalExchangeHeaders) {
const uint64_t kSignatureHeaderDate = 1517892341;
const uint64_t kSignatureHeaderExpires = 1517895941;

// See content/testdata/htxg/README on how to generate this data.
// See content/testdata/sxg/README on how to generate this data.
// clang-format off
constexpr char kSignatureHeaderRSA[] =
"label; "
Expand All @@ -78,7 +78,7 @@ constexpr char kSignatureHeaderRSA[] =
"date=1517892341; expires=1517895941";
// clang-format on

// See content/testdata/htxg/README on how to generate this data.
// See content/testdata/sxg/README on how to generate this data.
// clang-format off
constexpr char kSignatureHeaderECDSAP256[] =
"label; "
Expand All @@ -91,7 +91,7 @@ constexpr char kSignatureHeaderECDSAP256[] =
"date=1517892341; expires=1517895941";
// clang-format on

// See content/testdata/htxg/README on how to generate this data.
// See content/testdata/sxg/README on how to generate this data.
// clang-format off
constexpr char kSignatureHeaderECDSAP384[] =
"label; "
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion content/test/fuzzer/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ fuzzer_test("signed_exchange_envelope_fuzzer") {
"//base:i18n",
"//content/test:test_support",
]
seed_corpus = "//content/test/data/htxg/"
seed_corpus = "//content/test/data/sxg/"
}

fuzzer_test("signed_exchange_signature_header_field_fuzzer") {
Expand Down

0 comments on commit ba39085

Please sign in to comment.