summaryrefslogtreecommitdiff
path: root/chromium/webrunner/browser/webrunner_browser_main.cc
blob: fe0ec37a64d81269ff9ad5817dbd5bb3c5902d91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2018 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.

#include "webrunner/browser/webrunner_browser_main.h"

#include <memory>

#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "build/build_config.h"
#include "content/public/browser/browser_main_runner.h"

namespace webrunner {

int WebRunnerBrowserMain(const content::MainFunctionParams& parameters) {
  std::unique_ptr<content::BrowserMainRunner> main_runner(
      content::BrowserMainRunner::Create());
  int exit_code = main_runner->Initialize(parameters);
  if (exit_code >= 0)
    return exit_code;

  exit_code = main_runner->Run();

  main_runner->Shutdown();

  return exit_code;
}

}  // namespace webrunner