Override manifest handler registry in ManifestHandlerPerfTest.

MANUAL_CommonMeasureFinalization and MANUAL_CommonInitialize tests
reseted global registry on exit without initializing it again causing
random test flakes on tests that operated on manifests that happen to
run after those two tests (they passed on retry).

Change-Id: I2b4297d33441c72d9cdd099106abad68921c2f6a
Reviewed-on: https://chromium-review.googlesource.com/1259046
Commit-Queue: Marek Haranczyk <mharanczyk@opera.com>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596271}
diff --git a/extensions/common/manifest_handler_perf_test.cc b/extensions/common/manifest_handler_perf_test.cc
index 6500e26..f67a521 100644
--- a/extensions/common/manifest_handler_perf_test.cc
+++ b/extensions/common/manifest_handler_perf_test.cc
@@ -4,6 +4,7 @@
 
 #include "extensions/common/common_manifest_handlers.h"
 #include "extensions/common/manifest_handler.h"
+#include "extensions/common/scoped_testing_manifest_handler_registry.h"
 #include "extensions/test/logging_timer.h"
 
 #include "testing/gtest/include/gtest/gtest.h"
@@ -19,7 +20,7 @@
 // and should be run after any substantial changes to the related
 // code.
 TEST(ManifestHandlerPerfTest, MANUAL_CommonInitialize) {
-  ManifestHandlerRegistry::ResetForTesting();
+  ScopedTestingManifestHandlerRegistry scoped_registry;
   static constexpr char kTimerId[] = "CommonInitialize";
   for (int i = 0; i < 100000; ++i) {
     {
@@ -33,7 +34,7 @@
 }
 
 TEST(ManifestHandlerPerfTest, MANUAL_LookupTest) {
-  ManifestHandlerRegistry::ResetForTesting();
+  ScopedTestingManifestHandlerRegistry scoped_registry;
   RegisterCommonManifestHandlers();
   ManifestHandler::FinalizeRegistration();
   ManifestHandlerRegistry* registry = ManifestHandlerRegistry::Get();
@@ -54,7 +55,7 @@
 }
 
 TEST(ManifestHandlerPerfTest, MANUAL_CommonMeasureFinalization) {
-  ManifestHandlerRegistry::ResetForTesting();
+  ScopedTestingManifestHandlerRegistry scoped_registry;
   static constexpr char kTimerId[] = "Finalize";
   for (int i = 0; i < 100000; ++i) {
     {