Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2016 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. | |
| 4 | |
| 5 #include "blimp/engine/testing/app/content_testing_main.h" | |
| 6 | |
| 7 #include <iostream> | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/logging.h" | |
| 11 #include "blimp/engine/testing/app/blimp_url_rewriter.h" | |
| 12 #include "blimp/engine/testing/session/blimp_engine_testing_session.h" | |
| 13 #include "content/browser/browser_url_handler_impl.h" | |
| 14 #include "content/public/app/content_main_runner.h" | |
| 15 #include "content/public/browser/browser_url_handler.h" | |
| 16 #include "net/test/embedded_test_server/embedded_test_server.h" | |
| 17 | |
| 18 namespace blimp { | |
| 19 namespace engine { | |
| 20 | |
| 21 namespace test { | |
| 22 | |
| 23 const base::FilePath::CharType kBlimpTestRoot[] = FILE_PATH_LITERAL(""); | |
| 24 | |
| 25 int ContentTestingMain(const content::ContentMainParams& params) { | |
| 26 std::unique_ptr<content::ContentMainRunner> main_runner( | |
| 27 content::ContentMainRunner::Create()); | |
| 28 | |
| 29 int exit_code = main_runner->Initialize(params); | |
| 30 | |
| 31 blimp::engine::test::g_ets_instance.reset(new net::EmbeddedTestServer()); | |
| 32 blimp::engine::test::g_ets_instance->ServeFilesFromSourceDirectory( | |
| 33 base::FilePath(kBlimpTestRoot)); | |
| 34 DCHECK(blimp::engine::test::g_ets_instance->Start()); | |
|
shenghuazhang
2016/12/13 02:14:19
main_runner->Run() complains that Zygote should be
jbudorick
2016/12/13 18:31:03
We would definitely need to start the ETS instance
| |
| 35 | |
| 36 content::BrowserURLHandler::GetInstance()->AddHandlerPair( | |
| 37 &blimp::engine::test::HandleBlimpTestURL, | |
| 38 content::BrowserURLHandler::null_handler()); | |
| 39 | |
| 40 if (exit_code >= 0) | |
| 41 return exit_code; | |
| 42 | |
| 43 exit_code = main_runner->Run(); | |
| 44 | |
| 45 main_runner->Shutdown(); | |
| 46 | |
| 47 DCHECK(blimp::engine::test::g_ets_instance->ShutdownAndWaitUntilComplete()); | |
| 48 | |
| 49 return exit_code; | |
| 50 } | |
| 51 | |
| 52 } // namespace test | |
| 53 | |
| 54 } // namespace engine | |
| 55 } // namespace blimp | |
| OLD | NEW |