Index: chrome/common/sandbox_mac_unittest_helper.mm |
diff --git a/chrome/common/sandbox_mac_unittest_helper.mm b/chrome/common/sandbox_mac_unittest_helper.mm |
index 749bcc11a02300d4ebe04c6679db1332de5c0958..328e41182217697f7ce6dd8b8d5dadc6b4fae71e 100644 |
--- a/chrome/common/sandbox_mac_unittest_helper.mm |
+++ b/chrome/common/sandbox_mac_unittest_helper.mm |
@@ -24,11 +24,23 @@ namespace sandboxtest { |
// Support infrastructure for REGISTER_SANDBOX_TEST_CASE macro. |
namespace internal { |
+typedef std::map<std::string,MacSandboxTestCase*> SandboxTestMap; |
+ |
+// A function that returns a common map from string -> test case class. |
SandboxTestMap& GetSandboxTestMap() { |
static SandboxTestMap test_map; |
return test_map; |
} |
+void AddSandboxTestCase(const char* test_name, MacSandboxTestCase* test_class) { |
+ SandboxTestMap& test_map = GetSandboxTestMap(); |
+ if (test_map.find(test_name) != test_map.end()) { |
+ LOG(ERROR) << "Trying to register duplicate test" << test_name; |
+ NOTREACHED(); |
+ } |
+ test_map[test_name] = test_class; |
+} |
+ |
} // namespace internal |
bool MacSandboxTest:: RunTestInAllSandboxTypes(const char* test_name, |