Extension syncing: Introduce a NeedsSync pref
[chromium-blink-merge.git] / base / test / gtest_xml_unittest_result_printer.h
blob3b06b8542014da103a844481f7e3f7e8a48181db
1 // Copyright 2013 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 #ifndef BASE_TEST_GTEST_XML_UNITTEST_RESULT_PRINTER_H_
6 #define BASE_TEST_GTEST_XML_UNITTEST_RESULT_PRINTER_H_
8 #include <stdio.h>
10 #include "base/compiler_specific.h"
11 #include "base/macros.h"
12 #include "testing/gtest/include/gtest/gtest.h"
14 namespace base {
16 class FilePath;
18 // Generates an XML output file. Format is very close to GTest, but has
19 // extensions needed by the test launcher.
20 class XmlUnitTestResultPrinter : public testing::EmptyTestEventListener {
21 public:
22 XmlUnitTestResultPrinter();
23 ~XmlUnitTestResultPrinter() override;
25 // Must be called before adding as a listener. Returns true on success.
26 bool Initialize(const FilePath& output_file_path) WARN_UNUSED_RESULT;
28 private:
29 // testing::EmptyTestEventListener:
30 void OnTestCaseStart(const testing::TestCase& test_case) override;
31 void OnTestStart(const testing::TestInfo& test_info) override;
32 void OnTestEnd(const testing::TestInfo& test_info) override;
33 void OnTestCaseEnd(const testing::TestCase& test_case) override;
35 FILE* output_file_;
37 DISALLOW_COPY_AND_ASSIGN(XmlUnitTestResultPrinter);
40 } // namespace base
42 #endif // BASE_TEST_GTEST_XML_UNITTEST_RESULT_PRINTER_H_