bug 951354 - test nsNSSCertificateDB for proper shutdown r=cviecco a=abillings
☠☠ backed out by 1f9d7af12960 ☠ ☠
authorDavid Keeler <dkeeler@mozilla.com>
Fri, 17 Jan 2014 16:22:51 -0800
changeset 175863 24f26d63819a18071816c3b9075a677752639864
parent 175862 e8b536eebf26cca027f2320d56a71a3190d42c18
child 175864 1f9d7af129608aeadcf7c2720e9da6cee63fd354
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscviecco, abillings
bugs951354
milestone28.0a2
bug 951354 - test nsNSSCertificateDB for proper shutdown r=cviecco a=abillings
security/manager/ssl/tests/compiled/TestCertDB.cpp
security/manager/ssl/tests/compiled/moz.build
security/manager/ssl/tests/moz.build
new file mode 100644
--- /dev/null
+++ b/security/manager/ssl/tests/compiled/TestCertDB.cpp
@@ -0,0 +1,23 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "nsCOMPtr.h"
+#include "nsIX509CertDB.h"
+#include "nsServiceManagerUtils.h"
+
+int
+main(int argc, char* argv[])
+{
+  {
+    NS_InitXPCOM2(nullptr, nullptr, nullptr);
+    nsCOMPtr<nsIX509CertDB> certdb(do_GetService(NS_X509CERTDB_CONTRACTID));
+    if (!certdb) {
+      return -1;
+    }
+  } // this scopes the nsCOMPtrs
+  // no nsCOMPtrs are allowed to be alive when you call NS_ShutdownXPCOM
+  NS_ShutdownXPCOM(nullptr);
+  return 0;
+}
new file mode 100644
--- /dev/null
+++ b/security/manager/ssl/tests/compiled/moz.build
@@ -0,0 +1,9 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+CPP_UNIT_TESTS += [
+  'TestCertDB.cpp',
+]
--- a/security/manager/ssl/tests/moz.build
+++ b/security/manager/ssl/tests/moz.build
@@ -6,9 +6,13 @@
 
 DIRS += ['unit']
 
 TEST_DIRS += [
 	'gtest',
 	'mochitest',
 ]
 
+TEST_TOOL_DIRS += [
+  'compiled',
+]
+
 XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']