Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Unified Diff: extensions/browser/policy_check_unittest.cc

Issue 2802433004: ExtensionsTest: Move initialization to SetUp and avoid potential UAF. (Closed)
Patch Set: Avoid UAF. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: extensions/browser/policy_check_unittest.cc
diff --git a/extensions/browser/policy_check_unittest.cc b/extensions/browser/policy_check_unittest.cc
index 8b8af3057d2d42c91d3265f7c6d245d8c4781fa4..7d192b4c6c833cf2bbc638087db3cbbe1e5885dd 100644
--- a/extensions/browser/policy_check_unittest.cc
+++ b/extensions/browser/policy_check_unittest.cc
@@ -66,16 +66,16 @@ class TestExtensionSystem : public MockExtensionSystem {
class PolicyCheckTest : public ExtensionsTest {
public:
- PolicyCheckTest() {
- // Replace the MockExtensionSystemFactory set by ExtensionsTest.
- extensions_browser_client()->set_extension_system_factory(&factory_);
- }
+ PolicyCheckTest() {}
~PolicyCheckTest() override {}
void SetUp() override {
ExtensionsTest::SetUp();
+ // Replace the MockExtensionSystemFactory set by ExtensionsTest.
+ extensions_browser_client()->set_extension_system_factory(&factory_);
+
base::DictionaryValue manifest_dict;
manifest_dict.SetString("name", "dummy name");
manifest_dict.SetString("version", "1");

Powered by Google App Engine
This is Rietveld 408576698