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

Unified Diff: examples/apptest/example_apptest.cc

Issue 744973002: Pass command line args to apptests (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebase and address comments Created 6 years, 1 month 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
Index: examples/apptest/example_apptest.cc
diff --git a/examples/apptest/example_apptest.cc b/examples/apptest/example_apptest.cc
index b7a8e45daaaa53ace742685b66c8c75c9369cd23..2d50e16f353205759fd6b9b212264cbe4006ed18 100644
--- a/examples/apptest/example_apptest.cc
+++ b/examples/apptest/example_apptest.cc
@@ -17,8 +17,7 @@ namespace {
// Exemplifies ApplicationTestBase's application testing pattern.
class ExampleApplicationTest : public test::ApplicationTestBase {
public:
- // TODO(msw): Exemplify the use of actual command line arguments.
- ExampleApplicationTest() : ApplicationTestBase(Array<String>()) {}
+ ExampleApplicationTest() : ApplicationTestBase() {}
~ExampleApplicationTest() override {}
protected:
@@ -28,6 +27,7 @@ class ExampleApplicationTest : public test::ApplicationTestBase {
}
void SetUp() override {
ApplicationTestBase::SetUp();
+
application_impl()->ConnectToService("mojo:example_service",
&example_service_);
example_service_.set_client(&example_client_);
@@ -75,5 +75,12 @@ TEST_F(ExampleApplicationTest, RunCallbackViaService) {
EXPECT_TRUE(was_run);
}
+TEST_F(ExampleApplicationTest, CheckCommandLineArg) {
+ // apptest_runner.py adds this argument unconditionally so we can check
+ // for it here to verify that command line args are getting passed to
+ // apptests.
+ ASSERT_TRUE(application_impl()->HasArg("--example_apptest_arg"));
+}
+
} // namespace
} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698