Commit 40871382 authored by Marek Haranczyk's avatar Marek Haranczyk Committed by Commit Bot

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: default avatarDevlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596271}
parent ef5063ca
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "extensions/common/common_manifest_handlers.h" #include "extensions/common/common_manifest_handlers.h"
#include "extensions/common/manifest_handler.h" #include "extensions/common/manifest_handler.h"
#include "extensions/common/scoped_testing_manifest_handler_registry.h"
#include "extensions/test/logging_timer.h" #include "extensions/test/logging_timer.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
...@@ -19,7 +20,7 @@ namespace extensions { ...@@ -19,7 +20,7 @@ namespace extensions {
// and should be run after any substantial changes to the related // and should be run after any substantial changes to the related
// code. // code.
TEST(ManifestHandlerPerfTest, MANUAL_CommonInitialize) { TEST(ManifestHandlerPerfTest, MANUAL_CommonInitialize) {
ManifestHandlerRegistry::ResetForTesting(); ScopedTestingManifestHandlerRegistry scoped_registry;
static constexpr char kTimerId[] = "CommonInitialize"; static constexpr char kTimerId[] = "CommonInitialize";
for (int i = 0; i < 100000; ++i) { for (int i = 0; i < 100000; ++i) {
{ {
...@@ -33,7 +34,7 @@ TEST(ManifestHandlerPerfTest, MANUAL_CommonInitialize) { ...@@ -33,7 +34,7 @@ TEST(ManifestHandlerPerfTest, MANUAL_CommonInitialize) {
} }
TEST(ManifestHandlerPerfTest, MANUAL_LookupTest) { TEST(ManifestHandlerPerfTest, MANUAL_LookupTest) {
ManifestHandlerRegistry::ResetForTesting(); ScopedTestingManifestHandlerRegistry scoped_registry;
RegisterCommonManifestHandlers(); RegisterCommonManifestHandlers();
ManifestHandler::FinalizeRegistration(); ManifestHandler::FinalizeRegistration();
ManifestHandlerRegistry* registry = ManifestHandlerRegistry::Get(); ManifestHandlerRegistry* registry = ManifestHandlerRegistry::Get();
...@@ -54,7 +55,7 @@ TEST(ManifestHandlerPerfTest, MANUAL_LookupTest) { ...@@ -54,7 +55,7 @@ TEST(ManifestHandlerPerfTest, MANUAL_LookupTest) {
} }
TEST(ManifestHandlerPerfTest, MANUAL_CommonMeasureFinalization) { TEST(ManifestHandlerPerfTest, MANUAL_CommonMeasureFinalization) {
ManifestHandlerRegistry::ResetForTesting(); ScopedTestingManifestHandlerRegistry scoped_registry;
static constexpr char kTimerId[] = "Finalize"; static constexpr char kTimerId[] = "Finalize";
for (int i = 0; i < 100000; ++i) { for (int i = 0; i < 100000; ++i) {
{ {
......
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