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

Unified Diff: mojo/public/cpp/application/application_test_base.h

Issue 1990603002: Make ApplicationTestBase not use ApplicationImpl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: delete ApplicationImpl::WaitForInitialize() Created 4 years, 7 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/application_impl.h ('k') | mojo/public/cpp/application/lib/application_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/application/application_test_base.h
diff --git a/mojo/public/cpp/application/application_test_base.h b/mojo/public/cpp/application/application_test_base.h
index eb98b85c2b5df910c63dd77d8b3cb157d1724da0..a81119e963d5523bb3a2ad7bf68864d2e034c8d2 100644
--- a/mojo/public/cpp/application/application_test_base.h
+++ b/mojo/public/cpp/application/application_test_base.h
@@ -5,22 +5,19 @@
#ifndef MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_TEST_BASE_H_
#define MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_TEST_BASE_H_
-#include "mojo/public/cpp/application/application_delegate.h"
+#include <string>
+#include <vector>
+
#include "mojo/public/cpp/bindings/array.h"
#include "mojo/public/cpp/bindings/string.h"
#include "mojo/public/cpp/system/macros.h"
#include "mojo/public/interfaces/application/application.mojom.h"
+#include "mojo/public/interfaces/application/shell.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
-
-class ApplicationImpl;
-
namespace test {
-// Access the command line arguments passed to the application test.
-const Array<String>& Args();
-
// Run all application tests. This must be called after the environment is
// initialized, to support construction of a default run loop.
MojoResult RunAllTests(MojoHandle application_request_handle);
@@ -32,12 +29,8 @@ class ApplicationTestBase : public testing::Test {
~ApplicationTestBase() override;
protected:
- // TODO(vtl): Probably should get rid of this. There's really not much reason
- // to have an |ApplicationImpl|.
- ApplicationImpl* application_impl() { return application_impl_; }
-
- // Get the ApplicationDelegate for the application to be tested.
- virtual ApplicationDelegate* GetApplicationDelegate();
+ Shell* shell() const { return shell_.get(); }
+ const std::vector<std::string>& args() const { return args_; }
// testing::Test:
void SetUp() override;
@@ -49,16 +42,13 @@ class ApplicationTestBase : public testing::Test {
virtual bool ShouldCreateDefaultRunLoop();
private:
- // The application implementation instance, reconstructed for each test.
- ApplicationImpl* application_impl_;
- // The application delegate used if GetApplicationDelegate is not overridden.
- ApplicationDelegate default_application_delegate_;
+ ShellPtr shell_;
+ std::vector<std::string> args_;
MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationTestBase);
};
} // namespace test
-
} // namespace mojo
#endif // MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_TEST_BASE_H_
« no previous file with comments | « mojo/public/cpp/application/application_impl.h ('k') | mojo/public/cpp/application/lib/application_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698