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 |