function maybeGenHeader(testFixture) {
  if (!needGenHeader)
    return;
  needGenHeader = false;
  output(`
// GENERATED FILE'
${argHint}
// PLEASE DO NOT HAND EDIT!
`);

  // Output some C++ headers based upon the |testType|.
  //
  // Currently supports:
  // 'extension' - browser_tests harness, js2extension rule,
  //               ExtensionJSBrowserTest superclass.
  // 'unit' - unit_tests harness, js2unit rule, V8UnitTest superclass.
  // 'mojo_webui' - browser_tests harness, js2webui rule, MojoWebUIBrowserTest
  // superclass. Uses Mojo to communicate test results.
  // 'webui' - browser_tests harness, js2webui rule, WebUIBrowserTest
  // superclass. Uses chrome.send to communicate test results.
  if (testType === 'extension') {
    output('#include "chrome/test/base/extension_js_browser_test.h"');
    testing.Test.prototype.typedefCppFixture = 'ExtensionJSBrowserTest';
    addSetPreloadInfo = false;
    testF = 'IN_PROC_BROWSER_TEST_F';
  } else if (testType === 'unit') {
    output('#include "chrome/test/base/v8_unit_test.h"');
    testing.Test.prototype.typedefCppFixture = 'V8UnitTest';
    testF = 'TEST_F';
    addSetPreloadInfo = false;
  } else if (testType === 'mojo_webui') {
    output('#include "chrome/test/base/mojo_web_ui_browser_test.h"');
    testing.Test.prototype.typedefCppFixture = 'MojoWebUIBrowserTest';
    testF = 'IN_PROC_BROWSER_TEST_F';
    addSetPreloadInfo = true;
  } else if (testType === 'webui') {
    output('#include "chrome/test/base/web_ui_browser_test.h"');
    testing.Test.prototype.typedefCppFixture = 'WebUIBrowserTest';
    testF = 'IN_PROC_BROWSER_TEST_F';
    addSetPreloadInfo = true;
  }
  output(`
#include "url/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"`);
  // Add includes specified by test fixture.
  if (testFixture) {
    if (this[testFixture].prototype.testGenCppIncludes)
      this[testFixture].prototype.testGenCppIncludes();
    if (this[testFixture].prototype.commandLineSwitches)
      output('#include "base/command_line.h"');
    if (this[testFixture].prototype.featureList ||
        this[testFixture].prototype.featureWithParameters)
      output('#include "base/test/scoped_feature_list.h"');
  }
  output();
}
/**
 * Generates the header of the cc file to stdout.
 * @param {string?} testFixture Name of test fixture.
 */
Generates the header of the cc file to stdout.
@param {string?} testFixture Name of test fixture.
Generates the header of the cc file to stdout . @param { string? } testFixture Name of test fixture .
function maybeGenHeader(testFixture) {
  if (!needGenHeader)
    return;
  needGenHeader = false;
  output(`
 GENERATED FILE'
${argHint}
 PLEASE DO NOT HAND EDIT!
`);
   Currently supports:
   'extension' - browser_tests harness, js2extension rule,
                 ExtensionJSBrowserTest superclass.
   'unit' - unit_tests harness, js2unit rule, V8UnitTest superclass.
   'mojo_webui' - browser_tests harness, js2webui rule, MojoWebUIBrowserTest
   superclass. Uses Mojo to communicate test results.
   'webui' - browser_tests harness, js2webui rule, WebUIBrowserTest
   superclass. Uses chrome.send to communicate test results.
  if (testType === 'extension') {
    output('#include "chrome/test/base/extension_js_browser_test.h"');
    testing.Test.prototype.typedefCppFixture = 'ExtensionJSBrowserTest';
    addSetPreloadInfo = false;
    testF = 'IN_PROC_BROWSER_TEST_F';
  } else if (testType === 'unit') {
    output('#include "chrome/test/base/v8_unit_test.h"');
    testing.Test.prototype.typedefCppFixture = 'V8UnitTest';
    testF = 'TEST_F';
    addSetPreloadInfo = false;
  } else if (testType === 'mojo_webui') {
    output('#include "chrome/test/base/mojo_web_ui_browser_test.h"');
    testing.Test.prototype.typedefCppFixture = 'MojoWebUIBrowserTest';
    testF = 'IN_PROC_BROWSER_TEST_F';
    addSetPreloadInfo = true;
  } else if (testType === 'webui') {
    output('#include "chrome/test/base/web_ui_browser_test.h"');
    testing.Test.prototype.typedefCppFixture = 'WebUIBrowserTest';
    testF = 'IN_PROC_BROWSER_TEST_F';
    addSetPreloadInfo = true;
  }
  output(`
#include "url/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"`);
   Add includes specified by test fixture.
  if (testFixture) {
    if (this[testFixture].prototype.testGenCppIncludes)
      this[testFixture].prototype.testGenCppIncludes();
    if (this[testFixture].prototype.commandLineSwitches)
      output('#include "base/command_line.h"');
    if (this[testFixture].prototype.featureList ||
        this[testFixture].prototype.featureWithParameters)
      output('#include "base/test/scoped_feature_list.h"');
  }
  output();
}
function maybeGenHeader ( testFixture ) { if ( ! needGenHeader ) return ; needGenHeader = false ; output ( ` ${ argHint } ` ) ; if ( testType === 'extension' ) { output ( '#include "chrome/test/base/extension_js_browser_test.h"' ) ; testing . Test . prototype . typedefCppFixture = 'ExtensionJSBrowserTest' ; addSetPreloadInfo = false ; testF = 'IN_PROC_BROWSER_TEST_F' ; } else if ( testType === 'unit' ) { output ( '#include "chrome/test/base/v8_unit_test.h"' ) ; testing . Test . prototype . typedefCppFixture = 'V8UnitTest' ; testF = 'TEST_F' ; addSetPreloadInfo = false ; } else if ( testType === 'mojo_webui' ) { output ( '#include "chrome/test/base/mojo_web_ui_browser_test.h"' ) ; testing . Test . prototype . typedefCppFixture = 'MojoWebUIBrowserTest' ; testF = 'IN_PROC_BROWSER_TEST_F' ; addSetPreloadInfo = true ; } else if ( testType === 'webui' ) { output ( '#include "chrome/test/base/web_ui_browser_test.h"' ) ; testing . Test . prototype . typedefCppFixture = 'WebUIBrowserTest' ; testF = 'IN_PROC_BROWSER_TEST_F' ; addSetPreloadInfo = true ; } output ( ` ` ) ; if ( testFixture ) { if ( this [ testFixture ] . prototype . testGenCppIncludes ) this [ testFixture ] . prototype . testGenCppIncludes ( ) ; if ( this [ testFixture ] . prototype . commandLineSwitches ) output ( '#include "base/command_line.h"' ) ; if ( this [ testFixture ] . prototype . featureList || this [ testFixture ] . prototype . featureWithParameters ) output ( '#include "base/test/scoped_feature_list.h"' ) ; } output ( ) ; }
Generates the header of the cc file to stdout.
Generates the header of the cc file to stdout .
// Output some C++ headers based upon the |testType|. // // Currently supports: // 'extension' - browser_tests harness, js2extension rule, //               ExtensionJSBrowserTest superclass. // 'unit' - unit_tests harness, js2unit rule, V8UnitTest superclass. // 'mojo_webui' - browser_tests harness, js2webui rule, MojoWebUIBrowserTest // superclass. Uses Mojo to communicate test results. // 'webui' - browser_tests harness, js2webui rule, WebUIBrowserTest // superclass. Uses chrome.send to communicate test results. // Add includes specified by test fixture.