Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1275)

Unified Diff: mojo/public/cpp/application/lib/application_test_main.cc

Issue 830593003: Update mojo sdk to rev 9fbbc4f0fef1187312316c0ed992342474e139f1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cherry-pick mojo 9d3b8dd17f12d20035a14737fdc38dd926890ff8 Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/cpp/application/lib/application_test_base.cc ('k') | mojo/public/cpp/bindings/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/application/lib/application_test_main.cc
diff --git a/mojo/public/cpp/application/lib/application_test_main.cc b/mojo/public/cpp/application/lib/application_test_main.cc
index 31919f94ab74c122cc3e2c5afcd8c2ccc6256c01..47f36e92ab409d7fd177d78c3297d9fc3d5adec8 100644
--- a/mojo/public/cpp/application/lib/application_test_main.cc
+++ b/mojo/public/cpp/application/lib/application_test_main.cc
@@ -3,51 +3,12 @@
// found in the LICENSE file.
#include "mojo/public/c/system/main.h"
-#include "mojo/public/cpp/application/application_delegate.h"
-#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/application/application_test_base.h"
#include "mojo/public/cpp/environment/environment.h"
-#include "mojo/public/cpp/environment/logging.h"
-#include "mojo/public/cpp/system/message_pipe.h"
-#include "mojo/public/cpp/utility/run_loop.h"
MojoResult MojoMain(MojoHandle shell_handle) {
// An Environment instance is needed to construct run loops.
mojo::Environment environment;
- {
- // This loop is used for init, and then destroyed before running tests.
- mojo::RunLoop run_loop;
-
- // Construct an ApplicationImpl just for the GTEST commandline arguments.
- // GTEST command line arguments are supported amid application arguments:
- // $ mojo_shell mojo:example_apptests
- // --args-for='mojo:example_apptests arg1 --gtest_filter=foo arg2'
- mojo::ApplicationDelegate dummy_application_delegate;
- mojo::ApplicationImpl app(&dummy_application_delegate, shell_handle);
- MOJO_CHECK(app.WaitForInitialize());
-
- // InitGoogleTest expects (argc + 1) elements, including a terminating null.
- // It also removes GTEST arguments from |argv| and updates the |argc| count.
- const std::vector<std::string>& args = app.args();
- MOJO_CHECK(args.size() <
- static_cast<size_t>(std::numeric_limits<int>::max()));
- int argc = static_cast<int>(args.size());
- std::vector<const char*> argv(argc + 1);
- for (int i = 0; i < argc; ++i)
- argv[i] = args[i].c_str();
- argv[argc] = nullptr;
-
- testing::InitGoogleTest(&argc, const_cast<char**>(&(argv[0])));
- mojo::test::SetShellHandle(app.UnbindShell());
- mojo::test::InitializeArgs(argc, argv);
- }
-
- int result = RUN_ALL_TESTS();
-
- shell_handle = mojo::test::PassShellHandle().release().value();
- MojoResult close_result = MojoClose(shell_handle);
- MOJO_CHECK(close_result == MOJO_RESULT_OK);
-
- return (result == 0) ? MOJO_RESULT_OK : MOJO_RESULT_UNKNOWN;
+ return mojo::test::RunAllTests(shell_handle);
}
« no previous file with comments | « mojo/public/cpp/application/lib/application_test_base.cc ('k') | mojo/public/cpp/bindings/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698