Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / chrome / test / logging / win / test_log_collector.h
blob3f4ca7aeed52f0e4c76f2e2c14a8bb398d6dbffe
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // The test log collector uses Event Tracing for Windows to collect all LOG()
6 // events at all levels (including all VLOG levels) from Chrome, Chrome Frame,
7 // and the test executable itself for each test into a temporary log file. At
8 // the conclusion of each test, the contents of the log file are regurgitated to
9 // stderr iff the test failed. In any case, the log file is promptly deleted.
11 // Test executables that wish to benefit from the collector's features (to
12 // produce verbose logs on test failure to aid in diagnosing flaky and/or
13 // failing tests, for example) must install the collector via
14 // |InstallTestLogCollector| before running tests (via RUN_ALL_TESTS(),
15 // TestSuite::Run(), etc).
17 #ifndef CHROME_TEST_LOGGING_WIN_TEST_LOG_COLLECTOR_H_
18 #define CHROME_TEST_LOGGING_WIN_TEST_LOG_COLLECTOR_H_
20 namespace testing {
21 class UnitTest;
24 namespace logging_win {
26 // Installs the test log collector into |unit_test| for its lifetime.
27 // (Use testing::UnitTest::GetInstance() to get the process-wide unit test
28 // instance.)
29 void InstallTestLogCollector(testing::UnitTest* unit_test);
31 } // namespace logging_win
33 #endif // CHROME_TEST_LOGGING_WIN_TEST_LOG_COLLECTOR_H_