Chromium Code Reviews| Index: examples/apptest/example_apptest.cc |
| diff --git a/examples/apptest/example_apptest.cc b/examples/apptest/example_apptest.cc |
| index b7a8e45daaaa53ace742685b66c8c75c9369cd23..3b86746f57420917b8d752b33d3eced596ede81b 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(mojo::test::Args().Clone()) {} |
|
msw
2014/11/20 21:59:12
Maybe ApplicationTestBase should use the real argu
Chris Masone
2014/11/20 23:35:19
Done.
|
| ~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 |