Commit 9e05d93a authored by Julie Jeongeun Kim's avatar Julie Jeongeun Kim Committed by Commit Bot

Deprecate ResourceType in CrossSiteDocumentBlockingTest

This CL removes blink::mojom::ResourceType from
InspectHistograms() which is a helper method for
CrossSiteDocumentBlockingTest as it's unused and
blink::mojom::ResourceType is deprecated[1].

[1] https://crbug.com/960143

Bug: 1059639
Change-Id: I8679d716a3de44c2a8fe78a5ef5b330c073a488c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2525383Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Julie Kim <jkim@igalia.com>
Cr-Commit-Position: refs/heads/master@{#825598}
parent f9814b8b
......@@ -98,7 +98,6 @@ void InspectHistograms(
const base::HistogramTester& histograms,
const CorbExpectations& expectations,
const std::string& resource_name,
blink::mojom::ResourceType resource_type,
bool special_request_initiator_origin_lock_check_for_appcache = false) {
FetchHistogramsFromChildProcesses();
......@@ -500,8 +499,7 @@ class CrossSiteDocumentBlockingTestBase : public ContentBrowserTest {
interceptor.WaitForRequestCompletion();
// Verify...
InspectHistograms(histograms, expectations, resource,
blink::mojom::ResourceType::kImage);
InspectHistograms(histograms, expectations, resource);
interceptor.Verify(expectations,
GetTestFileContents("site_isolation", resource.c_str()));
}
......@@ -664,8 +662,7 @@ IN_PROC_BROWSER_TEST_P(CrossSiteDocumentBlockingTest, AllowCorsFetches) {
// Verify results of the fetch.
EXPECT_FALSE(was_blocked);
InspectHistograms(histograms, kShouldBeAllowedWithoutSniffing, resource,
blink::mojom::ResourceType::kXhr);
InspectHistograms(histograms, kShouldBeAllowedWithoutSniffing, resource);
}
}
......@@ -707,8 +704,8 @@ IN_PROC_BROWSER_TEST_P(CrossSiteDocumentBlockingTest,
// Verify that the response was not blocked.
EXPECT_EQ("runMe({ \"name\" : \"chromium\" });", fetch_result);
InspectHistograms(histograms, kShouldBeAllowedWithoutSniffing, "nosniff.html",
blink::mojom::ResourceType::kXhr);
InspectHistograms(histograms, kShouldBeAllowedWithoutSniffing,
"nosniff.html");
}
// Regression test for https://crbug.com/958421.
......@@ -742,8 +739,7 @@ IN_PROC_BROWSER_TEST_P(CrossSiteDocumentBlockingTest, BackToAboutBlank) {
FetchHistogramsFromChildProcesses();
base::HistogramTester histograms;
ASSERT_EQ("ok", EvalJs(popup, fetch_script));
InspectHistograms(histograms, kShouldBeAllowedWithoutSniffing, resource,
blink::mojom::ResourceType::kXhr);
InspectHistograms(histograms, kShouldBeAllowedWithoutSniffing, resource);
}
// Navigate the popup and then go back to the 'about:blank' URL.
......@@ -765,8 +761,7 @@ IN_PROC_BROWSER_TEST_P(CrossSiteDocumentBlockingTest, BackToAboutBlank) {
FetchHistogramsFromChildProcesses();
base::HistogramTester histograms;
ASSERT_EQ("ok", EvalJs(popup, fetch_script));
InspectHistograms(histograms, kShouldBeAllowedWithoutSniffing, resource,
blink::mojom::ResourceType::kXhr);
InspectHistograms(histograms, kShouldBeAllowedWithoutSniffing, resource);
}
}
......@@ -1084,8 +1079,8 @@ IN_PROC_BROWSER_TEST_P(CrossSiteDocumentBlockingTest, SharedWorker) {
// Verify that the response completed successfully, was blocked and was logged
// as having initially a non-empty body.
InspectHistograms(histograms, kShouldBeBlockedWithoutSniffing, "nosniff.json",
blink::mojom::ResourceType::kXhr);
InspectHistograms(histograms, kShouldBeBlockedWithoutSniffing,
"nosniff.json");
}
#endif // !defined(OS_ANDROID)
......@@ -1154,7 +1149,7 @@ IN_PROC_BROWSER_TEST_P(CrossSiteDocumentBlockingTest,
// Verify...
bool special_request_initiator_origin_lock_check_for_appcache = true;
InspectHistograms(histograms, kShouldBeBlockedWithoutSniffing,
"nosniff.json", blink::mojom::ResourceType::kImage,
"nosniff.json",
special_request_initiator_origin_lock_check_for_appcache);
interceptor.Verify(kShouldBeBlockedWithoutSniffing,
"no resource body needed for blocking verification");
......@@ -1375,8 +1370,7 @@ IN_PROC_BROWSER_TEST_P(CrossSiteDocumentBlockingTest, PrefetchIsNotImpacted) {
EXPECT_TRUE(ExecuteScriptAndExtractInt(shell()->web_contents(), wait_script,
&answer));
EXPECT_EQ(123, answer);
InspectHistograms(histograms, kShouldBeBlockedWithoutSniffing, "x.html",
blink::mojom::ResourceType::kPrefetch);
InspectHistograms(histograms, kShouldBeBlockedWithoutSniffing, "x.html");
// Finish the HTTP response - this should store the response in the cache.
response.Done();
......@@ -1549,8 +1543,7 @@ IN_PROC_BROWSER_TEST_F(CrossSiteDocumentBlockingServiceWorkerTest,
// Verify that CORB blocked the response from the network (from
// |cross_origin_https_server_|) to the service worker.
InspectHistograms(histograms, kShouldBeBlockedWithoutSniffing, "network.txt",
blink::mojom::ResourceType::kXhr);
InspectHistograms(histograms, kShouldBeBlockedWithoutSniffing, "network.txt");
// Verify that the service worker replied with an expected error.
// Replying with an error means that CORB is only active once (for the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment