[Code Health] Rewrite test helpers to return values.
It's better to return a value instead of doing assertions in the
helper, so that test failures include the line number in the test
body, rather than the line number in the test helper.
This also grants tests the flexibility to differentiate expectations
from assertions during test setup (e.g. in api_browsertest.cc).
This CL also adds two expectations that were mistakenly omitted from
https://crrev.com/c/3749906.
Change-Id: Id22f16f020cf66cedaf20f7e17048a5905b322bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3750281
Reviewed-by: Maks Orlovich <[email protected]>
Reviewed-by: Vasilii Sukhanov <[email protected]>
Auto-Submit: Chris Fredrickson <[email protected]>
Commit-Queue: Vasilii Sukhanov <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1022652}
diff --git a/chrome/browser/net/cookie_policy_browsertest.cc b/chrome/browser/net/cookie_policy_browsertest.cc
index c21bcee3..c5408a8 100644
--- a/chrome/browser/net/cookie_policy_browsertest.cc
+++ b/chrome/browser/net/cookie_policy_browsertest.cc
@@ -113,8 +113,8 @@
EXPECT_TRUE(NavigateIframeToURL(web_contents, "test", page));
}
- void ExpectFrameContent(const std::string& expected) {
- storage::test::ExpectFrameContent(GetFrame(), expected);
+ std::string GetFrameContent() {
+ return storage::test::GetFrameContent(GetFrame());
}
void SetCookieViaJS(content::RenderFrameHost* frame,
@@ -140,8 +140,8 @@
load_observer.Wait();
}
- void ExpectNestedFrameContent(const std::string& expected) {
- storage::test::ExpectFrameContent(GetNestedFrame(), expected);
+ std::string GetNestedFrameContent() {
+ return storage::test::GetFrameContent(GetNestedFrame());
}
content::RenderFrameHost* GetFrame() {
@@ -355,13 +355,13 @@
NavigateToPageWithFrame(kHostA);
- storage::test::ExpectCookiesOnHost(browser()->profile(), GetURL(kHostB), "");
+ EXPECT_EQ(content::GetCookies(browser()->profile(), GetURL(kHostB)), "");
// Navigate iframe to a cross-site, cookie-setting endpoint, and verify that
// the cookie is set:
NavigateFrameTo(kHostB, "/set-cookie?thirdparty=1;SameSite=None;Secure");
- storage::test::ExpectCookiesOnHost(browser()->profile(), GetURL(kHostB),
- "thirdparty=1");
+ EXPECT_EQ(content::GetCookies(browser()->profile(), GetURL(kHostB)),
+ "thirdparty=1");
// Navigate iframe to a cross-site frame with a frame, and navigate _that_
// frame to a cross-site, cookie-setting endpoint, and verify that the cookie
@@ -371,8 +371,8 @@
// is still cross-site.
NavigateNestedFrameTo(kHostB,
"/set-cookie?thirdparty=2;SameSite=None;Secure");
- storage::test::ExpectCookiesOnHost(browser()->profile(), GetURL(kHostB),
- "thirdparty=2");
+ EXPECT_EQ(content::GetCookies(browser()->profile(), GetURL(kHostB)),
+ "thirdparty=2");
// Navigate iframe to a cross-site frame with a frame, and navigate _that_
// frame to a cross-site, cookie-setting endpoint, and verify that the cookie
@@ -380,8 +380,8 @@
NavigateFrameTo(kHostC, "/iframe.html");
NavigateNestedFrameTo(kHostB,
"/set-cookie?thirdparty=3;SameSite=None;Secure");
- storage::test::ExpectCookiesOnHost(browser()->profile(), GetURL(kHostB),
- "thirdparty=3");
+ EXPECT_EQ(content::GetCookies(browser()->profile(), GetURL(kHostB)),
+ "thirdparty=3");
}
// This test does the same navigations as the test above, so we can be assured
@@ -397,7 +397,7 @@
// Navigate iframe to a cross-site, cookie-setting endpoint, and verify that
// the cookie is not set:
NavigateFrameTo(kHostB, "/set-cookie?thirdparty=1;SameSite=None;Secure");
- storage::test::ExpectCookiesOnHost(browser()->profile(), GetURL(kHostB), "");
+ EXPECT_EQ(content::GetCookies(browser()->profile(), GetURL(kHostB)), "");
// Navigate iframe to a cross-site frame with a frame, and navigate _that_
// frame to a cross-site, cookie-setting endpoint, and verify that the cookie
@@ -405,7 +405,7 @@
NavigateFrameTo(kHostB, "/iframe.html");
NavigateNestedFrameTo(kHostB,
"/set-cookie?thirdparty=2;SameSite=None;Secure");
- storage::test::ExpectCookiesOnHost(browser()->profile(), GetURL(kHostB), "");
+ EXPECT_EQ(content::GetCookies(browser()->profile(), GetURL(kHostB)), "");
// Navigate iframe to a cross-site frame with a frame, and navigate _that_
// frame to a cross-site, cookie-setting endpoint, and verify that the cookie
@@ -413,7 +413,7 @@
NavigateFrameTo(kHostC, "/iframe.html");
NavigateNestedFrameTo(kHostB,
"/set-cookie?thirdparty=3;SameSite=None;Secure");
- storage::test::ExpectCookiesOnHost(browser()->profile(), GetURL(kHostB), "");
+ EXPECT_EQ(content::GetCookies(browser()->profile(), GetURL(kHostB)), "");
}
IN_PROC_BROWSER_TEST_F(CookiePolicyBrowserTest,
@@ -423,29 +423,29 @@
// Set a cookie on `b.test`.
content::SetCookie(browser()->profile(), https_server_.GetURL(kHostB, "/"),
"thirdparty=1;SameSite=None;Secure");
- storage::test::ExpectCookiesOnHost(browser()->profile(), GetURL(kHostB),
- "thirdparty=1");
+ EXPECT_EQ(content::GetCookies(browser()->profile(), GetURL(kHostB)),
+ "thirdparty=1");
NavigateToPageWithFrame(kHostA);
// Navigate iframe to a cross-site, cookie-reading endpoint, and verify that
// the cookie is sent:
NavigateFrameTo(kHostB, "/echoheader?cookie");
- ExpectFrameContent("thirdparty=1");
+ EXPECT_EQ(GetFrameContent(), "thirdparty=1");
// Navigate iframe to a cross-site frame with a frame, and navigate _that_
// frame to a cross-site page that echoes the cookie header, and verify that
// the cookie is sent:
NavigateFrameTo(kHostB, "/iframe.html");
NavigateNestedFrameTo(kHostB, "/echoheader?cookie");
- ExpectNestedFrameContent("thirdparty=1");
+ EXPECT_EQ(GetNestedFrameContent(), "thirdparty=1");
// Navigate iframe to a cross-site frame with a frame, and navigate _that_
// frame to a distinct cross-site page that echoes the cookie header, and
// verify that the cookie is not sent:
NavigateFrameTo(kHostC, "/iframe.html");
NavigateNestedFrameTo(kHostB, "/echoheader?cookie");
- ExpectNestedFrameContent("thirdparty=1");
+ EXPECT_EQ(GetNestedFrameContent(), "thirdparty=1");
}
// This test does the same navigations as the test above, so we can be assured
@@ -459,29 +459,29 @@
// Set a cookie on `b.test`.
content::SetCookie(browser()->profile(), https_server_.GetURL(kHostB, "/"),
"thirdparty=1;SameSite=None;Secure");
- storage::test::ExpectCookiesOnHost(browser()->profile(), GetURL(kHostB),
- "thirdparty=1");
+ EXPECT_EQ(content::GetCookies(browser()->profile(), GetURL(kHostB)),
+ "thirdparty=1");
NavigateToPageWithFrame(kHostA);
// Navigate iframe to a cross-site, cookie-reading endpoint, and verify that
// the cookie is not sent:
NavigateFrameTo(kHostB, "/echoheader?cookie");
- ExpectFrameContent("None");
+ EXPECT_EQ(GetFrameContent(), "None");
// Navigate iframe to a cross-site frame with a frame, and navigate _that_
// frame to a cross-site page that echoes the cookie header, and verify that
// the cookie is not sent:
NavigateFrameTo(kHostB, "/iframe.html");
NavigateNestedFrameTo(kHostB, "/echoheader?cookie");
- ExpectNestedFrameContent("None");
+ EXPECT_EQ(GetNestedFrameContent(), "None");
// Navigate iframe to a cross-site frame with a frame, and navigate _that_
// frame to a distinct cross-site page that echoes the cookie header, and
// verify that the cookie is not sent:
NavigateFrameTo(kHostC, "/iframe.html");
NavigateNestedFrameTo(kHostB, "/echoheader?cookie");
- ExpectNestedFrameContent("None");
+ EXPECT_EQ(GetNestedFrameContent(), "None");
}
IN_PROC_BROWSER_TEST_F(CookiePolicyBrowserTest,
@@ -491,14 +491,14 @@
// Set a cookie on `b.test`.
content::SetCookie(browser()->profile(), https_server_.GetURL(kHostB, "/"),
"thirdparty=1;SameSite=None;Secure");
- storage::test::ExpectCookiesOnHost(browser()->profile(), GetURL(kHostB),
- "thirdparty=1");
+ EXPECT_EQ(content::GetCookies(browser()->profile(), GetURL(kHostB)),
+ "thirdparty=1");
// Set a cookie on d.test.
content::SetCookie(browser()->profile(), https_server_.GetURL(kHostD, "/"),
"thirdparty=other;SameSite=None;Secure");
- storage::test::ExpectCookiesOnHost(browser()->profile(), GetURL(kHostD),
- "thirdparty=other");
+ EXPECT_EQ(content::GetCookies(browser()->profile(), GetURL(kHostD)),
+ "thirdparty=other");
// Allow all requests to b.test to have cookies.
// On the other hand, d.test does not have an exception set for it.
@@ -511,32 +511,32 @@
// Navigate iframe to a cross-site, cookie-reading endpoint, and verify that
// the cookie is sent:
NavigateFrameTo(kHostB, "/echoheader?cookie");
- ExpectFrameContent("thirdparty=1");
+ EXPECT_EQ(GetFrameContent(), "thirdparty=1");
// Navigate iframe to d.test and verify that the cookie is not sent.
NavigateFrameTo(kHostD, "/echoheader?cookie");
- ExpectFrameContent("None");
+ EXPECT_EQ(GetFrameContent(), "None");
// Navigate iframe to a cross-site frame with a frame, and navigate _that_
// frame to a cross-site page that echoes the cookie header, and verify that
// the cookie is sent:
NavigateFrameTo(kHostB, "/iframe.html");
NavigateNestedFrameTo(kHostB, "/echoheader?cookie");
- ExpectNestedFrameContent("thirdparty=1");
+ EXPECT_EQ(GetNestedFrameContent(), "thirdparty=1");
// Navigate nested iframe to d.test and verify that the cookie is not
// sent.
NavigateNestedFrameTo(kHostD, "/echoheader?cookie");
- ExpectNestedFrameContent("None");
+ EXPECT_EQ(GetNestedFrameContent(), "None");
// Navigate iframe to a cross-site frame with a frame, and navigate _that_
// frame to a distinct cross-site page that echoes the cookie header, and
// verify that the cookie is sent:
NavigateFrameTo(kHostC, "/iframe.html");
NavigateNestedFrameTo(kHostB, "/echoheader?cookie");
- ExpectNestedFrameContent("thirdparty=1");
+ EXPECT_EQ(GetNestedFrameContent(), "thirdparty=1");
// Navigate nested iframe to d.test and verify that the cookie is not
// sent.
NavigateNestedFrameTo(kHostD, "/echoheader?cookie");
- ExpectNestedFrameContent("None");
+ EXPECT_EQ(GetNestedFrameContent(), "None");
}
IN_PROC_BROWSER_TEST_F(CookiePolicyBrowserTest,
@@ -546,8 +546,8 @@
// Set a cookie on `b.test`.
content::SetCookie(browser()->profile(), https_server_.GetURL(kHostB, "/"),
"thirdparty=1;SameSite=None;Secure");
- storage::test::ExpectCookiesOnHost(browser()->profile(), GetURL(kHostB),
- "thirdparty=1");
+ EXPECT_EQ(content::GetCookies(browser()->profile(), GetURL(kHostB)),
+ "thirdparty=1");
// Allow all requests on the top frame domain a.test to have cookies.
GURL url = https_server_.GetURL(kHostA, "/");
@@ -559,21 +559,21 @@
// Navigate iframe to a cross-site, cookie-reading endpoint, and verify that
// the cookie is sent:
NavigateFrameTo(kHostB, "/echoheader?cookie");
- ExpectFrameContent("thirdparty=1");
+ EXPECT_EQ(GetFrameContent(), "thirdparty=1");
// Navigate iframe to a cross-site frame with a frame, and navigate _that_
// frame to a cross-site page that echoes the cookie header, and verify that
// the cookie is sent:
NavigateFrameTo(kHostB, "/iframe.html");
NavigateNestedFrameTo(kHostB, "/echoheader?cookie");
- ExpectNestedFrameContent("thirdparty=1");
+ EXPECT_EQ(GetNestedFrameContent(), "thirdparty=1");
// Navigate iframe to a cross-site frame with a frame, and navigate _that_
// frame to a distinct cross-site page that echoes the cookie header, and
// verify that the cookie is sent:
NavigateFrameTo(kHostC, "/iframe.html");
NavigateNestedFrameTo(kHostB, "/echoheader?cookie");
- ExpectNestedFrameContent("thirdparty=1");
+ EXPECT_EQ(GetNestedFrameContent(), "thirdparty=1");
// Now repeat the above with a different top frame site, which does not have
// an exception set for it.
@@ -582,21 +582,21 @@
// Navigate iframe to a cross-site, cookie-reading endpoint, and verify that
// the cookie is not sent:
NavigateFrameTo(kHostB, "/echoheader?cookie");
- ExpectFrameContent("None");
+ EXPECT_EQ(GetFrameContent(), "None");
// Navigate iframe to a cross-site frame with a frame, and navigate _that_
// frame to a cross-site page that echoes the cookie header, and verify that
// the cookie is not sent:
NavigateFrameTo(kHostB, "/iframe.html");
NavigateNestedFrameTo(kHostB, "/echoheader?cookie");
- ExpectNestedFrameContent("None");
+ EXPECT_EQ(GetNestedFrameContent(), "None");
// Navigate iframe to a cross-site frame with a frame, and navigate _that_
// frame to a distinct cross-site page that echoes the cookie header, and
// verify that the cookie is not sent:
NavigateFrameTo(kHostC, "/iframe.html");
NavigateNestedFrameTo(kHostB, "/echoheader?cookie");
- ExpectNestedFrameContent("None");
+ EXPECT_EQ(GetNestedFrameContent(), "None");
}
IN_PROC_BROWSER_TEST_F(CookiePolicyBrowserTest,
@@ -819,7 +819,7 @@
// A(B)
NavigateToPageWithFrame(kHostA);
NavigateFrameTo(kHostB, "/echoheader?cookie");
- ExpectFrameContent(OrNone(ExpectedSamePartyCookies()));
+ EXPECT_EQ(GetFrameContent(), OrNone(ExpectedSamePartyCookies()));
// Navigate iframe to a cross-site, same-party frame with a frame, and
// navigate _that_ frame to a cross-site page that echoes the cookie header,
@@ -827,7 +827,7 @@
// A(C(B))
NavigateFrameTo(kHostC, "/iframe.html");
NavigateNestedFrameTo(kHostB, "/echoheader?cookie");
- ExpectNestedFrameContent(OrNone(ExpectedSamePartyCookies()));
+ EXPECT_EQ(GetNestedFrameContent(), OrNone(ExpectedSamePartyCookies()));
// Navigate iframe to a cross-site, cross-party frame with a frame, and
// navigate _that_ frame to a distinct cross-site page that echoes the cookie
@@ -835,20 +835,20 @@
// A(D(B))
NavigateFrameTo(kHostD, "/iframe.html");
NavigateNestedFrameTo(kHostB, "/echoheader?cookie");
- ExpectNestedFrameContent(OrNone(ExpectedCrossPartyCookies()));
+ EXPECT_EQ(GetNestedFrameContent(), OrNone(ExpectedCrossPartyCookies()));
// Navigate to a page with a cross-party iframe, and verify cookie access.
// D(B)
NavigateToPageWithFrame(kHostD);
NavigateFrameTo(kHostB, "/echoheader?cookie");
- ExpectFrameContent(OrNone(ExpectedCrossPartyCookies()));
+ EXPECT_EQ(GetFrameContent(), OrNone(ExpectedCrossPartyCookies()));
// Navigate to a cross-party page that embeds an iframe and a nested iframe
// (that is same-party to the other iframe), and verify cookie access.
// D(A(B))
NavigateFrameTo(kHostA, "/iframe.html");
NavigateNestedFrameTo(kHostB, "/echoheader?cookie");
- ExpectNestedFrameContent(OrNone(ExpectedCrossPartyCookies()));
+ EXPECT_EQ(GetNestedFrameContent(), OrNone(ExpectedCrossPartyCookies()));
}
IN_PROC_BROWSER_TEST_P(SamePartyIsFirstPartyCookiePolicyBrowserTest, Write_JS) {
@@ -955,7 +955,7 @@
https_server_.GetURL(kHostA, "/echoheader?cookie").spec(),
/*use_plus=*/false),
}));
- ExpectFrameContent(AllCookies());
+ EXPECT_EQ(GetFrameContent(), AllCookies());
}
IN_PROC_BROWSER_TEST_P(SamePartyIsFirstPartyCookiePolicyBrowserTest,
@@ -979,7 +979,7 @@
https_server_.GetURL(kHostA, "/echoheader?cookie").spec(),
/*use_plus=*/false),
}));
- ExpectFrameContent(AllCookies());
+ EXPECT_EQ(GetFrameContent(), AllCookies());
}
INSTANTIATE_TEST_SUITE_P(FlagAndSettings,
diff --git a/chrome/browser/net/samesite_cookies_policy_browsertest.cc b/chrome/browser/net/samesite_cookies_policy_browsertest.cc
index 4ad4658..5938b0f 100644
--- a/chrome/browser/net/samesite_cookies_policy_browsertest.cc
+++ b/chrome/browser/net/samesite_cookies_policy_browsertest.cc
@@ -97,9 +97,8 @@
EXPECT_TRUE(NavigateIframeToURL(web_contents, "test", page));
}
- void ExpectFrameContent(content::RenderFrameHost* frame,
- const std::string& expected) {
- storage::test::ExpectFrameContent(frame, expected);
+ std::string GetFrameContent(content::RenderFrameHost* frame) {
+ return storage::test::GetFrameContent(frame);
}
bool IsSchemefulSameSiteEnabled() { return GetParam(); }
@@ -250,15 +249,15 @@
//
// Start by navigating to an insecure page with an iframe.
NavigateToHttpPageWithFrame("a.test");
- storage::test::ExpectCookiesOnHost(browser()->profile(),
- GetURL("a.test", false /* secure */),
- "strictcookie=1");
+ EXPECT_EQ(content::GetCookies(browser()->profile(),
+ GetURL("a.test", false /* secure */)),
+ "strictcookie=1");
// Then navigate the frame to a secure page and check to see if the cookie is
// sent.
NavigateFrameToHttps("a.test", "/echoheader?cookie");
// The legacy cookie should have been sent.
- ExpectFrameContent(GetChildFrame(), "strictcookie=1");
+ EXPECT_EQ(GetFrameContent(GetChildFrame()), "strictcookie=1");
}
IN_PROC_BROWSER_TEST_P(SameSiteCookiesPolicyTest,
@@ -276,16 +275,16 @@
// Start by navigating to an insecure page with an iframe. The cookie will
// always be present because it is a same-schemeful-site context.
NavigateToHttpPageWithFrame("a.test");
- storage::test::ExpectCookiesOnHost(browser()->profile(),
- GetURL("a.test", false /* secure */),
- "strictcookie=1");
+ EXPECT_EQ(content::GetCookies(browser()->profile(),
+ GetURL("a.test", false /* secure */)),
+ "strictcookie=1");
// Then navigate the frame to a secure page and check to see if the cookie is
// sent.
NavigateFrameToHttps("a.test", "/echoheader?cookie");
// The cookie will be sent only if Schemeful Same-Site is not active.
- ExpectFrameContent(GetChildFrame(),
- IsSchemefulSameSiteEnabled() ? "None" : "strictcookie=1");
+ EXPECT_EQ(GetFrameContent(GetChildFrame()),
+ IsSchemefulSameSiteEnabled() ? "None" : "strictcookie=1");
}
IN_PROC_BROWSER_TEST_P(SameSiteCookiesPolicyTest,
@@ -309,7 +308,7 @@
ASSERT_TRUE(
NavigateToURLFromRenderer(GetPrimaryMainFrame(), secure_echo_url));
- ExpectFrameContent(GetPrimaryMainFrame(), "strictcookie=1");
+ EXPECT_EQ(GetFrameContent(GetPrimaryMainFrame()), "strictcookie=1");
}
IN_PROC_BROWSER_TEST_P(SameSiteCookiesPolicyTest,
@@ -328,8 +327,8 @@
ASSERT_TRUE(
NavigateToURLFromRenderer(GetPrimaryMainFrame(), secure_echo_url));
- ExpectFrameContent(GetPrimaryMainFrame(),
- IsSchemefulSameSiteEnabled() ? "None" : "strictcookie=1");
+ EXPECT_EQ(GetFrameContent(GetPrimaryMainFrame()),
+ IsSchemefulSameSiteEnabled() ? "None" : "strictcookie=1");
}
INSTANTIATE_TEST_SUITE_P(All, SameSiteCookiesPolicyTest, ::testing::Bool());
diff --git a/chrome/browser/net/storage_test_utils.cc b/chrome/browser/net/storage_test_utils.cc
index f361c74..86a1295c 100644
--- a/chrome/browser/net/storage_test_utils.cc
+++ b/chrome/browser/net/storage_test_utils.cc
@@ -35,15 +35,8 @@
" () => { window.domAutomationController.send(false); },"
");";
-void ExpectFrameContent(content::RenderFrameHost* frame,
- const std::string& expected) {
- EXPECT_EQ(expected, content::EvalJs(frame, "document.body.textContent"));
-}
-
-void ExpectCookiesOnHost(content::BrowserContext* context,
- const GURL& host_url,
- const std::string& expected) {
- EXPECT_EQ(expected, content::GetCookies(context, host_url));
+std::string GetFrameContent(content::RenderFrameHost* frame) {
+ return content::EvalJs(frame, "document.body.textContent").ExtractString();
}
void SetStorageForFrame(content::RenderFrameHost* frame) {
@@ -115,20 +108,16 @@
}
}
-void RequestStorageAccessForFrame(content::RenderFrameHost* frame,
- bool should_resolve) {
- bool data = content::EvalJs(frame, kRequestStorageAccess,
- content::EXECUTE_SCRIPT_USE_MANUAL_REPLY)
- .ExtractBool();
- EXPECT_EQ(should_resolve, data) << "document.requestStorageAccess()";
+bool RequestStorageAccessForFrame(content::RenderFrameHost* frame) {
+ return content::EvalJs(frame, kRequestStorageAccess,
+ content::EXECUTE_SCRIPT_USE_MANUAL_REPLY)
+ .ExtractBool();
}
-void CheckStorageAccessForFrame(content::RenderFrameHost* frame,
- bool access_expected) {
- bool data = content::EvalJs(frame, kHasStorageAccess,
- content::EXECUTE_SCRIPT_USE_MANUAL_REPLY)
- .ExtractBool();
- EXPECT_EQ(access_expected, data) << "document.hasStorageAccess()";
+bool HasStorageAccessForFrame(content::RenderFrameHost* frame) {
+ return content::EvalJs(frame, kHasStorageAccess,
+ content::EXECUTE_SCRIPT_USE_MANUAL_REPLY)
+ .ExtractBool();
}
} // namespace test
diff --git a/chrome/browser/net/storage_test_utils.h b/chrome/browser/net/storage_test_utils.h
index 76b9796..274f663 100644
--- a/chrome/browser/net/storage_test_utils.h
+++ b/chrome/browser/net/storage_test_utils.h
@@ -7,25 +7,15 @@
#include <string>
-class GURL;
-
namespace content {
-class BrowserContext;
class RenderFrameHost;
} // namespace content
namespace storage {
namespace test {
-// Helper to validate a given frame contains the |expected| contents as their
-// document body.
-void ExpectFrameContent(content::RenderFrameHost* frame,
- const std::string& expected);
-// Helper to validate a given for a given |context| and |host_url| that
-// |expected| cookies are present.
-void ExpectCookiesOnHost(content::BrowserContext* context,
- const GURL& host_url,
- const std::string& expected);
+// Gets the text content of a given frame.
+std::string GetFrameContent(content::RenderFrameHost* frame);
// Helpers to set and check various types of storage on a given frame. Typically
// used on page like //chrome/test/data/browsing_data/site_data.html
@@ -40,13 +30,13 @@
void ExpectCrossTabInfoForFrame(content::RenderFrameHost* frame, bool expected);
// Helper to request storage access for a frame using
-// document.requestStorageAccess()
-void RequestStorageAccessForFrame(content::RenderFrameHost* frame,
- bool should_resolve);
-// Helper to validate if a frame currently has storage access using
-// document.hasStorageAccess()
-void CheckStorageAccessForFrame(content::RenderFrameHost* frame,
- bool access_expected);
+// document.requestStorageAccess(). Returns true if the promise resolves; false
+// if it rejects.
+bool RequestStorageAccessForFrame(content::RenderFrameHost* frame);
+// Helper to see if a frame currently has storage access using
+// document.hasStorageAccess(). Returns true if the promise resolves with a
+// value of true; false otherwise.
+bool HasStorageAccessForFrame(content::RenderFrameHost* frame);
} // namespace test
} // namespace storage
diff --git a/chrome/browser/storage_access_api/api_browsertest.cc b/chrome/browser/storage_access_api/api_browsertest.cc
index 63e6049a..d31cc68 100644
--- a/chrome/browser/storage_access_api/api_browsertest.cc
+++ b/chrome/browser/storage_access_api/api_browsertest.cc
@@ -105,8 +105,8 @@
EXPECT_TRUE(NavigateIframeToURL(web_contents, "test", page));
}
- void ExpectFrameContent(const std::string& expected) {
- storage::test::ExpectFrameContent(GetFrame(), expected);
+ std::string GetFrameContent() {
+ return storage::test::GetFrameContent(GetFrame());
}
void NavigateNestedFrameTo(const std::string& host, const std::string& path) {
@@ -121,8 +121,8 @@
load_observer.Wait();
}
- void ExpectNestedFrameContent(const std::string& expected) {
- storage::test::ExpectFrameContent(GetNestedFrame(), expected);
+ std::string GetNestedFrameContent() {
+ return storage::test::GetFrameContent(GetNestedFrame());
}
std::string ReadCookiesViaJS(content::RenderFrameHost* render_frame_host) {
@@ -162,25 +162,26 @@
// Set a cookie on `b.com`.
content::SetCookie(browser()->profile(), https_server().GetURL("b.com", "/"),
"thirdparty=1;SameSite=None;Secure");
- storage::test::ExpectCookiesOnHost(browser()->profile(), GetURL("b.com"),
- "thirdparty=1");
+ ASSERT_EQ(content::GetCookies(browser()->profile(), GetURL("b.com")),
+ "thirdparty=1");
// Set a cookie on othersite.com.
content::SetCookie(browser()->profile(),
https_server().GetURL("othersite.com", "/"),
"thirdparty=other;SameSite=None;Secure");
- storage::test::ExpectCookiesOnHost(
- browser()->profile(), GetURL("othersite.com"), "thirdparty=other");
+ ASSERT_EQ(content::GetCookies(browser()->profile(), GetURL("othersite.com")),
+ "thirdparty=other");
NavigateToPageWithFrame("a.com");
// Allow all requests for b.com to have cookie access from a.com.
// On the other hand, othersite.com does not have an exception set for it.
NavigateFrameTo("b.com", "/echoheader?cookie");
- ExpectFrameContent("None");
- storage::test::CheckStorageAccessForFrame(GetFrame(), false);
- storage::test::RequestStorageAccessForFrame(GetFrame(), true);
- storage::test::CheckStorageAccessForFrame(GetFrame(), true);
+ EXPECT_EQ(GetFrameContent(), "None");
+ EXPECT_EQ(ReadCookiesViaJS(GetFrame()), "");
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetFrame()));
+ EXPECT_TRUE(storage::test::RequestStorageAccessForFrame(GetFrame()));
+ EXPECT_TRUE(storage::test::HasStorageAccessForFrame(GetFrame()));
// Our use counter should not have fired yet, so we should have 0 occurrences.
histogram_tester.ExpectBucketCount(
@@ -194,9 +195,9 @@
// Navigate iframe to a cross-site, cookie-reading endpoint, and verify that
// the cookie is sent:
NavigateFrameTo("b.com", "/echoheader?cookie");
- ExpectFrameContent("thirdparty=1");
+ EXPECT_EQ(GetFrameContent(), "thirdparty=1");
EXPECT_EQ(ReadCookiesViaJS(GetFrame()), "thirdparty=1");
- storage::test::CheckStorageAccessForFrame(GetFrame(), true);
+ EXPECT_TRUE(storage::test::HasStorageAccessForFrame(GetFrame()));
// Since the frame has navigated we should see the use counter telem appear.
histogram_tester.ExpectBucketCount(
@@ -209,39 +210,39 @@
// Navigate iframe to othersite.com and verify that the cookie is not sent.
NavigateFrameTo("othersite.com", "/echoheader?cookie");
- ExpectFrameContent("None");
+ EXPECT_EQ(GetFrameContent(), "None");
EXPECT_EQ(ReadCookiesViaJS(GetFrame()), "");
- storage::test::CheckStorageAccessForFrame(GetFrame(), false);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetFrame()));
// Navigate iframe to a cross-site frame with a frame, and navigate _that_
// frame to a cross-site page that echos the cookie header, and verify that
// the cookie is sent:
NavigateFrameTo("b.com", "/iframe.html");
NavigateNestedFrameTo("b.com", "/echoheader?cookie");
- ExpectNestedFrameContent("thirdparty=1");
+ EXPECT_EQ(GetNestedFrameContent(), "thirdparty=1");
EXPECT_EQ(ReadCookiesViaJS(GetNestedFrame()), "thirdparty=1");
- storage::test::CheckStorageAccessForFrame(GetNestedFrame(), true);
+ EXPECT_TRUE(storage::test::HasStorageAccessForFrame(GetNestedFrame()));
// Navigate nested iframe to othersite.com and verify that the cookie is not
// sent.
NavigateNestedFrameTo("othersite.com", "/echoheader?cookie");
- ExpectNestedFrameContent("None");
+ EXPECT_EQ(GetNestedFrameContent(), "None");
EXPECT_EQ(ReadCookiesViaJS(GetNestedFrame()), "");
- storage::test::CheckStorageAccessForFrame(GetNestedFrame(), false);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetNestedFrame()));
// Navigate iframe to a cross-site frame with a frame, and navigate _that_
// frame to a distinct cross-site page that echos the cookie header, and
// verify that the cookie is sent:
NavigateFrameTo("c.com", "/iframe.html");
NavigateNestedFrameTo("b.com", "/echoheader?cookie");
- ExpectNestedFrameContent("thirdparty=1");
+ EXPECT_EQ(GetNestedFrameContent(), "thirdparty=1");
EXPECT_EQ(ReadCookiesViaJS(GetNestedFrame()), "thirdparty=1");
- storage::test::CheckStorageAccessForFrame(GetNestedFrame(), true);
+ EXPECT_TRUE(storage::test::HasStorageAccessForFrame(GetNestedFrame()));
// Navigate nested iframe to othersite.com and verify that the cookie is not
// sent.
NavigateNestedFrameTo("othersite.com", "/echoheader?cookie");
- ExpectNestedFrameContent("None");
+ EXPECT_EQ(GetNestedFrameContent(), "None");
EXPECT_EQ(ReadCookiesViaJS(GetNestedFrame()), "");
- storage::test::CheckStorageAccessForFrame(GetNestedFrame(), false);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetNestedFrame()));
// Navigate our top level to d.com and verify that all requests for b.com are
// now blocked in that context.
@@ -250,27 +251,27 @@
// Navigate iframe to a cross-site, cookie-reading endpoint, and verify that
// the cookie is blocked:
NavigateFrameTo("b.com", "/echoheader?cookie");
- ExpectFrameContent("None");
+ EXPECT_EQ(GetFrameContent(), "None");
EXPECT_EQ(ReadCookiesViaJS(GetFrame()), "");
- storage::test::CheckStorageAccessForFrame(GetFrame(), false);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetFrame()));
// Navigate iframe to a cross-site frame with a frame, and navigate _that_
// frame to a cross-site page that echos the cookie header, and verify that
// the cookie is blocked:
NavigateFrameTo("b.com", "/iframe.html");
NavigateNestedFrameTo("b.com", "/echoheader?cookie");
- ExpectNestedFrameContent("None");
+ EXPECT_EQ(GetNestedFrameContent(), "None");
EXPECT_EQ(ReadCookiesViaJS(GetNestedFrame()), "");
- storage::test::CheckStorageAccessForFrame(GetNestedFrame(), false);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetNestedFrame()));
// Navigate iframe to a cross-site frame with a frame, and navigate _that_
// frame to a distinct cross-site page that echos the cookie header, and
// verify that the cookie is blocked:
NavigateFrameTo("c.com", "/iframe.html");
NavigateNestedFrameTo("b.com", "/echoheader?cookie");
- ExpectNestedFrameContent("None");
+ EXPECT_EQ(GetNestedFrameContent(), "None");
EXPECT_EQ(ReadCookiesViaJS(GetNestedFrame()), "");
- storage::test::CheckStorageAccessForFrame(GetNestedFrame(), false);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetNestedFrame()));
}
// Validate that the Storage Access API does not override any explicit user
@@ -282,47 +283,47 @@
// Set a cookie on `b.com`.
content::SetCookie(browser()->profile(), https_server().GetURL("b.com", "/"),
"thirdparty=1;SameSite=None;Secure");
- storage::test::ExpectCookiesOnHost(browser()->profile(), GetURL("b.com"),
- "thirdparty=1");
+ ASSERT_EQ(content::GetCookies(browser()->profile(), GetURL("b.com")),
+ "thirdparty=1");
NavigateToPageWithFrame("a.com");
NavigateFrameTo("b.com", "/echoheader?cookie");
- storage::test::CheckStorageAccessForFrame(GetFrame(), false);
- storage::test::RequestStorageAccessForFrame(GetFrame(), true);
- storage::test::CheckStorageAccessForFrame(GetFrame(), true);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetFrame()));
+ EXPECT_TRUE(storage::test::RequestStorageAccessForFrame(GetFrame()));
+ EXPECT_TRUE(storage::test::HasStorageAccessForFrame(GetFrame()));
// Block all cookies with a user setting for b.com.
auto cookie_settings =
CookieSettingsFactory::GetForProfile(browser()->profile());
GURL url = https_server().GetURL("b.com", "/");
cookie_settings->SetCookieSetting(url, ContentSetting::CONTENT_SETTING_BLOCK);
- storage::test::CheckStorageAccessForFrame(GetFrame(), false);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetFrame()));
// Navigate iframe to a cross-site, cookie-reading endpoint, and verify that
// the cookie is blocked:
NavigateFrameTo("b.com", "/echoheader?cookie");
- ExpectFrameContent("None");
+ EXPECT_EQ(GetFrameContent(), "None");
EXPECT_EQ(ReadCookiesViaJS(GetFrame()), "");
- storage::test::CheckStorageAccessForFrame(GetFrame(), false);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetFrame()));
// Navigate iframe to a cross-site frame with a frame, and navigate _that_
// frame to a cross-site page that echos the cookie header, and verify that
// the cookie is blocked:
NavigateFrameTo("b.com", "/iframe.html");
NavigateNestedFrameTo("b.com", "/echoheader?cookie");
- ExpectNestedFrameContent("None");
+ EXPECT_EQ(GetNestedFrameContent(), "None");
EXPECT_EQ(ReadCookiesViaJS(GetNestedFrame()), "");
- storage::test::CheckStorageAccessForFrame(GetNestedFrame(), false);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetNestedFrame()));
// Navigate iframe to a cross-site frame with a frame, and navigate _that_
// frame to a distinct cross-site page that echos the cookie header, and
// verify that the cookie is blocked:
NavigateFrameTo("c.com", "/iframe.html");
NavigateNestedFrameTo("b.com", "/echoheader?cookie");
- ExpectNestedFrameContent("None");
+ EXPECT_EQ(GetNestedFrameContent(), "None");
EXPECT_EQ(ReadCookiesViaJS(GetNestedFrame()), "");
- storage::test::CheckStorageAccessForFrame(GetNestedFrame(), false);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetNestedFrame()));
}
// Test third-party cookie blocking of features that allow to communicate
@@ -334,30 +335,30 @@
storage::test::ExpectCrossTabInfoForFrame(GetFrame(), false);
storage::test::SetCrossTabInfoForFrame(GetFrame());
storage::test::ExpectCrossTabInfoForFrame(GetFrame(), true);
- storage::test::CheckStorageAccessForFrame(GetFrame(), true);
+ EXPECT_TRUE(storage::test::HasStorageAccessForFrame(GetFrame()));
// Create a second tab to test communication between tabs.
NavigateToNewTabWithFrame("a.com");
NavigateFrameTo("b.com", "/browsing_data/site_data.html");
storage::test::ExpectCrossTabInfoForFrame(GetFrame(), true);
- storage::test::CheckStorageAccessForFrame(GetFrame(), true);
+ EXPECT_TRUE(storage::test::HasStorageAccessForFrame(GetFrame()));
SetBlockThirdPartyCookies(true);
NavigateToPageWithFrame("a.com");
NavigateFrameTo("b.com", "/browsing_data/site_data.html");
storage::test::ExpectCrossTabInfoForFrame(GetFrame(), false);
- storage::test::CheckStorageAccessForFrame(GetFrame(), false);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetFrame()));
// Allow all requests to b.com to access cookies.
// Allow all requests to b.com on a.com to access storage.
- storage::test::RequestStorageAccessForFrame(GetFrame(), true);
- storage::test::CheckStorageAccessForFrame(GetFrame(), true);
+ EXPECT_TRUE(storage::test::RequestStorageAccessForFrame(GetFrame()));
+ EXPECT_TRUE(storage::test::HasStorageAccessForFrame(GetFrame()));
NavigateToPageWithFrame("a.com");
NavigateFrameTo("b.com", "/browsing_data/site_data.html");
storage::test::ExpectCrossTabInfoForFrame(GetFrame(), true);
- storage::test::CheckStorageAccessForFrame(GetFrame(), true);
+ EXPECT_TRUE(storage::test::HasStorageAccessForFrame(GetFrame()));
}
// Validates that once a grant is removed access is also removed.
@@ -368,21 +369,22 @@
// Set a cookie on `b.com`.
content::SetCookie(browser()->profile(), https_server().GetURL("b.com", "/"),
"thirdparty=1;SameSite=None;Secure");
- storage::test::ExpectCookiesOnHost(browser()->profile(), GetURL("b.com"),
- "thirdparty=1");
+ ASSERT_EQ(content::GetCookies(browser()->profile(), GetURL("b.com")),
+ "thirdparty=1");
NavigateToPageWithFrame("a.com");
NavigateFrameTo("b.com", "/echoheader?cookie");
- storage::test::CheckStorageAccessForFrame(GetFrame(), false);
- storage::test::RequestStorageAccessForFrame(GetFrame(), true);
- storage::test::CheckStorageAccessForFrame(GetFrame(), true);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetFrame()));
+ EXPECT_TRUE(storage::test::RequestStorageAccessForFrame(GetFrame()));
+ EXPECT_TRUE(storage::test::HasStorageAccessForFrame(GetFrame()));
// Navigate iframe to a cross-site, cookie-reading endpoint, and verify that
// the cookie is sent:
NavigateFrameTo("b.com", "/echoheader?cookie");
- ExpectFrameContent("thirdparty=1");
- storage::test::CheckStorageAccessForFrame(GetFrame(), true);
+ EXPECT_EQ(GetFrameContent(), "thirdparty=1");
+ EXPECT_EQ(ReadCookiesViaJS(GetFrame()), "thirdparty=1");
+ EXPECT_TRUE(storage::test::HasStorageAccessForFrame(GetFrame()));
// Manually delete all our grants.
HostContentSettingsMap* settings_map =
@@ -390,9 +392,9 @@
settings_map->ClearSettingsForOneType(ContentSettingsType::STORAGE_ACCESS);
NavigateFrameTo("b.com", "/echoheader?cookie");
- ExpectFrameContent("None");
+ EXPECT_EQ(GetFrameContent(), "None");
EXPECT_EQ(ReadCookiesViaJS(GetFrame()), "");
- storage::test::CheckStorageAccessForFrame(GetFrame(), false);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetFrame()));
}
IN_PROC_BROWSER_TEST_F(StorageAccessAPIBrowserTest, OpaqueOriginRejects) {
@@ -404,9 +406,9 @@
"document.querySelector('iframe').sandbox='allow-scripts';"));
NavigateFrameTo("b.com", "/echoheader?cookie");
- storage::test::CheckStorageAccessForFrame(GetFrame(), false);
- storage::test::RequestStorageAccessForFrame(GetFrame(), false);
- storage::test::CheckStorageAccessForFrame(GetFrame(), false);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetFrame()));
+ EXPECT_FALSE(storage::test::RequestStorageAccessForFrame(GetFrame()));
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetFrame()));
}
IN_PROC_BROWSER_TEST_F(StorageAccessAPIBrowserTest,
@@ -419,9 +421,9 @@
"scripts allow-same-origin';"));
NavigateFrameTo("b.com", "/echoheader?cookie");
- storage::test::CheckStorageAccessForFrame(GetFrame(), false);
- storage::test::RequestStorageAccessForFrame(GetFrame(), false);
- storage::test::CheckStorageAccessForFrame(GetFrame(), false);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetFrame()));
+ EXPECT_FALSE(storage::test::RequestStorageAccessForFrame(GetFrame()));
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetFrame()));
}
IN_PROC_BROWSER_TEST_F(StorageAccessAPIBrowserTest, SandboxTokenResolves) {
@@ -434,9 +436,9 @@
"allow-same-origin allow-storage-access-by-user-activation';"));
NavigateFrameTo("b.com", "/echoheader?cookie");
- storage::test::CheckStorageAccessForFrame(GetFrame(), false);
- storage::test::RequestStorageAccessForFrame(GetFrame(), true);
- storage::test::CheckStorageAccessForFrame(GetFrame(), true);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetFrame()));
+ EXPECT_TRUE(storage::test::RequestStorageAccessForFrame(GetFrame()));
+ EXPECT_TRUE(storage::test::HasStorageAccessForFrame(GetFrame()));
}
// Validates that expiry data is transferred over IPC to the Network Service.
@@ -447,18 +449,18 @@
// Set a cookie on `b.com` and `c.com`.
content::SetCookie(browser()->profile(), https_server().GetURL("b.com", "/"),
"thirdparty=b;SameSite=None;Secure");
- storage::test::ExpectCookiesOnHost(browser()->profile(), GetURL("b.com"),
- "thirdparty=b");
+ ASSERT_EQ(content::GetCookies(browser()->profile(), GetURL("b.com")),
+ "thirdparty=b");
content::SetCookie(browser()->profile(), https_server().GetURL("c.com", "/"),
"thirdparty=c;SameSite=None;Secure");
- storage::test::ExpectCookiesOnHost(browser()->profile(), GetURL("c.com"),
- "thirdparty=c");
+ ASSERT_EQ(content::GetCookies(browser()->profile(), GetURL("c.com")),
+ "thirdparty=c");
NavigateToPageWithFrame("a.com");
NavigateFrameTo("b.com", "/iframe.html");
NavigateNestedFrameTo("c.com", "/echoheader?cookie");
- storage::test::CheckStorageAccessForFrame(GetFrame(), false);
- storage::test::CheckStorageAccessForFrame(GetNestedFrame(), false);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetFrame()));
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetNestedFrame()));
// Manually create a pre-expired grant and ensure it doesn't grant access.
base::Time expiration_time = base::Time::Now() - base::Minutes(5);
@@ -494,14 +496,14 @@
->GetCookieManagerForBrowserProcess()
->SetStorageAccessGrantSettings(settings, base::DoNothing());
- storage::test::CheckStorageAccessForFrame(GetFrame(), false);
- storage::test::CheckStorageAccessForFrame(GetNestedFrame(), true);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetFrame()));
+ EXPECT_TRUE(storage::test::HasStorageAccessForFrame(GetNestedFrame()));
NavigateFrameTo("b.com", "/iframe.html");
NavigateNestedFrameTo("c.com", "/echoheader?cookie");
- storage::test::CheckStorageAccessForFrame(GetFrame(), false);
- storage::test::CheckStorageAccessForFrame(GetNestedFrame(), true);
- ExpectNestedFrameContent("thirdparty=c");
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetFrame()));
+ EXPECT_TRUE(storage::test::HasStorageAccessForFrame(GetNestedFrame()));
+ EXPECT_EQ(GetNestedFrameContent(), "thirdparty=c");
EXPECT_EQ(ReadCookiesViaJS(GetNestedFrame()), "thirdparty=c");
}
@@ -555,16 +557,16 @@
NavigateToPageWithFrame("a.com");
NavigateFrameTo("b.com", "/browsing_data/site_data.html");
ExpectStorage(test_type, GetFrame(), false);
- storage::test::CheckStorageAccessForFrame(GetFrame(), false);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetFrame()));
// Allow all requests to b.com on a.com to access storage.
- storage::test::RequestStorageAccessForFrame(GetFrame(), true);
- storage::test::CheckStorageAccessForFrame(GetFrame(), true);
+ EXPECT_TRUE(storage::test::RequestStorageAccessForFrame(GetFrame()));
+ EXPECT_TRUE(storage::test::HasStorageAccessForFrame(GetFrame()));
NavigateToPageWithFrame("a.com");
NavigateFrameTo("b.com", "/browsing_data/site_data.html");
ExpectStorage(test_type, GetFrame(), true);
- storage::test::CheckStorageAccessForFrame(GetFrame(), true);
+ EXPECT_TRUE(storage::test::HasStorageAccessForFrame(GetFrame()));
}
IN_PROC_BROWSER_TEST_P(StorageAccessAPIStorageBrowserTest,
@@ -585,17 +587,17 @@
NavigateFrameTo("b.com", "/iframe.html");
NavigateNestedFrameTo("c.com", "/browsing_data/site_data.html");
ExpectStorage(test_type, GetNestedFrame(), false);
- storage::test::CheckStorageAccessForFrame(GetNestedFrame(), false);
+ EXPECT_FALSE(storage::test::HasStorageAccessForFrame(GetNestedFrame()));
// Allow all requests to b.com on a.com to access storage.
- storage::test::RequestStorageAccessForFrame(GetNestedFrame(), true);
- storage::test::CheckStorageAccessForFrame(GetNestedFrame(), true);
+ EXPECT_TRUE(storage::test::RequestStorageAccessForFrame(GetNestedFrame()));
+ EXPECT_TRUE(storage::test::HasStorageAccessForFrame(GetNestedFrame()));
NavigateToPageWithFrame("a.com");
NavigateFrameTo("b.com", "/iframe.html");
NavigateNestedFrameTo("c.com", "/browsing_data/site_data.html");
ExpectStorage(test_type, GetNestedFrame(), true);
- storage::test::CheckStorageAccessForFrame(GetNestedFrame(), true);
+ EXPECT_TRUE(storage::test::HasStorageAccessForFrame(GetNestedFrame()));
}
INSTANTIATE_TEST_SUITE_P(/*no prefix*/,