| Auto-Submit | +1 |
| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
Thanks Devlin! This one was surprisingly smooth! Just a few nits, but LGTM other than those.
class DeclarativeNetRequestLazyApiTest : public DeclarativeNetRequestApiTest {
public:
DeclarativeNetRequestLazyApiTest() = default;nit: we can just delete this now and `:%s/DeclarativeNetRequestLazyApiTest/DeclarativeNetRequestApiTest/g`
// This test explicitly exercises capabilities linked to MV2
// (webRequestBlocking). This can be updated in the future with e.g.
// a policy-installed extension.nit: We should preface this comment with the fact that this test still relies on an MV2 extension. At the moment it's just the justification for 'why' that is the case, without stating the actual 'what'.
Also to double check, does a policy-installed extension sound like the right path forward to still test the behavior with an MV3 extension?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
| Commit-Queue | +2 |
class DeclarativeNetRequestLazyApiTest : public DeclarativeNetRequestApiTest {
public:
DeclarativeNetRequestLazyApiTest() = default;nit: we can just delete this now and `:%s/DeclarativeNetRequestLazyApiTest/DeclarativeNetRequestApiTest/g`
Done
// This test explicitly exercises capabilities linked to MV2
// (webRequestBlocking). This can be updated in the future with e.g.
// a policy-installed extension.nit: We should preface this comment with the fact that this test still relies on an MV2 extension. At the moment it's just the justification for 'why' that is the case, without stating the actual 'what'.
Also to double check, does a policy-installed extension sound like the right path forward to still test the behavior with an MV3 extension?
Updated (to also phrase it in the form of a TODO), and yep, using a policy-installed extension will work here.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
2 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: chrome/browser/extensions/api/declarative_net_request/declarative_net_request_apitest.cc
Insertions: 13, Deletions: 18.
@@ -75,16 +75,11 @@
base::test::ScopedFeatureList feature_list_;
};
-class DeclarativeNetRequestLazyApiTest : public DeclarativeNetRequestApiTest {
- public:
- DeclarativeNetRequestLazyApiTest() = default;
-};
-
-IN_PROC_BROWSER_TEST_F(DeclarativeNetRequestLazyApiTest, DynamicRules) {
+IN_PROC_BROWSER_TEST_F(DeclarativeNetRequestApiTest, DynamicRules) {
ASSERT_TRUE(RunExtensionTest("dynamic_rules")) << message_;
}
-IN_PROC_BROWSER_TEST_F(DeclarativeNetRequestLazyApiTest, RegexRuleMessage) {
+IN_PROC_BROWSER_TEST_F(DeclarativeNetRequestApiTest, RegexRuleMessage) {
// Ensure the error message for large RegEx rules is updated with the
// correct value for the memory limit.
std::string expected_amount = base::StringPrintf(
@@ -94,7 +89,7 @@
}
class DeclarativeNetRequestSafeRulesLazyApiTest
- : public DeclarativeNetRequestLazyApiTest {
+ : public DeclarativeNetRequestApiTest {
public:
DeclarativeNetRequestSafeRulesLazyApiTest() {
scoped_feature_list_.InitAndEnableFeature(
@@ -143,29 +138,29 @@
#if !BUILDFLAG(IS_ANDROID)
// TODO(crbug.com/371432155): Port to desktop Android when chrome.tabs API is
// available.
-IN_PROC_BROWSER_TEST_F(DeclarativeNetRequestLazyApiTest, OnRulesMatchedDebug) {
+IN_PROC_BROWSER_TEST_F(DeclarativeNetRequestApiTest, OnRulesMatchedDebug) {
ASSERT_TRUE(RunExtensionTest("on_rules_matched_debug")) << message_;
}
-// This test explicitly exercises capabilities linked to MV2
-// (webRequestBlocking). This can be updated in the future with e.g.
-// a policy-installed extension.
+// TODO(https://crbug.com/491516661): This test uses an MV2 extension because it
+// explicitly exercises capabilities linked to MV2 (webRequestBlocking). This
+// can be updated in the future with e.g. a policy-installed extension.
IN_PROC_BROWSER_TEST_F(DeclarativeNetRequestApiTest, ModifyHeaders) {
ASSERT_TRUE(RunExtensionTest("modify_headers")) << message_;
}
// TODO(crbug.com/371432155): Port to desktop Android when chrome.tabs API is
// available.
-IN_PROC_BROWSER_TEST_F(DeclarativeNetRequestLazyApiTest, GetMatchedRules) {
+IN_PROC_BROWSER_TEST_F(DeclarativeNetRequestApiTest, GetMatchedRules) {
ASSERT_TRUE(RunExtensionTest("get_matched_rules")) << message_;
}
#endif // !BUILDFLAG(IS_ANDROID)
-IN_PROC_BROWSER_TEST_F(DeclarativeNetRequestLazyApiTest, IsRegexSupported) {
+IN_PROC_BROWSER_TEST_F(DeclarativeNetRequestApiTest, IsRegexSupported) {
ASSERT_TRUE(RunExtensionTest("is_regex_supported")) << message_;
}
-IN_PROC_BROWSER_TEST_F(DeclarativeNetRequestLazyApiTest, TestMatchOutcome) {
+IN_PROC_BROWSER_TEST_F(DeclarativeNetRequestApiTest, TestMatchOutcome) {
ASSERT_TRUE(RunExtensionTest("test_match_outcome")) << message_;
}
@@ -200,7 +195,7 @@
#if !BUILDFLAG(IS_ANDROID)
class DeclarativeNetRequestApiPrerenderingTest
- : public DeclarativeNetRequestLazyApiTest {
+ : public DeclarativeNetRequestApiTest {
public:
DeclarativeNetRequestApiPrerenderingTest() = default;
~DeclarativeNetRequestApiPrerenderingTest() override = default;
@@ -218,7 +213,7 @@
#endif
class DeclarativeNetRequestLazyApiResponseHeadersTest
- : public DeclarativeNetRequestLazyApiTest {
+ : public DeclarativeNetRequestApiTest {
public:
DeclarativeNetRequestLazyApiResponseHeadersTest() {
scoped_feature_list_.InitAndEnableFeature(
@@ -228,7 +223,7 @@
private:
// TODO(crbug.com/40727004): Once feature is launched to stable and feature
// flag can be removed, replace usages of this test class with just
- // DeclarativeNetRequestLazyApiTest.
+ // DeclarativeNetRequestApiTest.
base::test::ScopedFeatureList scoped_feature_list_;
ScopedCurrentChannel current_channel_override_{version_info::Channel::DEV};
};
```
[Extensions] Update declarativeNetRequest API tests to MV3
MV2 has been unsupported for several months. We can remove testing
support for it. Existing tests should be updated to MV3.
Update API tests for the declarativeNetRequest API to use manifest
version 3 instead of manifest version 2 and 3.
With the transition to MV3, many of these tests may also be able to be
updated to use new patterns, such as async / await, service worker
modules, and more. However, those changes are out of scope for these
CLs, and can be addressed in followups.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |