diff options
author | aa <aa@chromium.org> | 2014-10-30 17:56:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-31 00:56:23 +0000 |
commit | a158c0118feb755acff2d601bf436072ef4d90e5 (patch) | |
tree | e8146587f3f85f69a03be66f2f2753d5752b528b /mojo/public/cpp/application/application_test_base.h | |
parent | e6e040a21c78c9097600312d761c0295fa9312f1 (diff) | |
download | chromium_src-a158c0118feb755acff2d601bf436072ef4d90e5.zip chromium_src-a158c0118feb755acff2d601bf436072ef4d90e5.tar.gz chromium_src-a158c0118feb755acff2d601bf436072ef4d90e5.tar.bz2 |
Update mojo sdk to rev e083961bf11fd0c94d40be8853761da529b6d444
This relands https://codereview.chromium.org/683583002/
TBR=jamesr@chromium.org
Review URL: https://codereview.chromium.org/695583002
Cr-Commit-Position: refs/heads/master@{#302203}
Diffstat (limited to 'mojo/public/cpp/application/application_test_base.h')
-rw-r--r-- | mojo/public/cpp/application/application_test_base.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/mojo/public/cpp/application/application_test_base.h b/mojo/public/cpp/application/application_test_base.h new file mode 100644 index 0000000..7fe38d2 --- /dev/null +++ b/mojo/public/cpp/application/application_test_base.h @@ -0,0 +1,50 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_TEST_BASE_H_ +#define MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_TEST_BASE_H_ + +#include "mojo/public/cpp/bindings/array.h" +#include "mojo/public/cpp/bindings/string.h" +#include "mojo/public/cpp/system/macros.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace mojo { + +class ApplicationDelegate; +class ApplicationImpl; + +namespace test { + +// A GTEST base class for application testing executed in mojo_shell. +class ApplicationTestBase : public testing::Test { + public: + explicit ApplicationTestBase(Array<String> args); + ~ApplicationTestBase() override; + + protected: + ApplicationImpl* application_impl() { return application_impl_; } + + // Get the ApplicationDelegate for the application to be tested. + virtual ApplicationDelegate* GetApplicationDelegate() = 0; + + // testing::Test: + void SetUp() override; + void TearDown() override; + + private: + // The command line arguments supplied to each test application instance. + Array<String> args_; + + // The application implementation instance, reconstructed for each test. + ApplicationImpl* application_impl_; + + MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationTestBase); +}; + +} // namespace test + +} // namespace mojo + +#endif // MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_TEST_BASE_H_ |