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

Unified Diff: chrome/test/base/test_log_collector_win.h

Issue 9584017: New test infrastructure for producing verbose logs in failing tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: capture trace events as well Created 8 years, 10 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: chrome/test/base/test_log_collector_win.h
diff --git a/chrome/test/base/test_log_collector_win.h b/chrome/test/base/test_log_collector_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..2f29320edec21534bfc49a230ca8ddc272bc1c6f
--- /dev/null
+++ b/chrome/test/base/test_log_collector_win.h
@@ -0,0 +1,30 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// The test log collector uses Event Tracing for Windows to collect all LOG()
+// events at all levels (including all VLOG levels) from Chrome, Chrome Frame,
+// and the test executable itself for each test into a temporary log file. At
+// the conclusion of each test, the contents of the log file are regurgitated to
+// stderr iff the test failed. In any case, the log file is promptly deleted.
+//
+// Test executables that wish to benefit from the collector's features (to
+// produce verbose logs on test failure to aid in diagnosing flaky and/or
+// failing tests, for example) must install the collector via
+// |InstallTestLogCollector| before running tests (via RUN_ALL_TESTS(),
+// TestSuite::Run(), etc).
+
+#ifndef CHROME_TEST_BASE_TEST_LOG_COLLECTOR_WIN_H_
+#define CHROME_TEST_BASE_TEST_LOG_COLLECTOR_WIN_H_
+#pragma once
+
+namespace testing {
+class UnitTest;
+}
+
+// Installs the test log collector into |unit_test| for its lifetime.
+// (Use testing::UnitTest::GetInstance() to get the process-wide unit test
+// instance.)
+void InstallTestLogCollector(testing::UnitTest* unit_test);
+
+#endif // CHROME_TEST_BASE_TEST_LOG_COLLECTOR_WIN_H_

Powered by Google App Engine
This is Rietveld 408576698