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

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

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 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/shell/public/cpp/application_impl.h ('k') | mojo/shell/public/cpp/lib/application_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/public/cpp/application_test_base.h
diff --git a/mojo/shell/public/cpp/application_test_base.h b/mojo/shell/public/cpp/application_test_base.h
index a4f162ee77e20c3b4a19095cd24d91b8741ad662..1dc35163e77938c37c719476dce6987bb1e85c89 100644
--- a/mojo/shell/public/cpp/application_test_base.h
+++ b/mojo/shell/public/cpp/application_test_base.h
@@ -10,6 +10,7 @@
#include "mojo/public/cpp/bindings/string.h"
#include "mojo/public/cpp/system/macros.h"
#include "mojo/shell/public/cpp/application_delegate.h"
+#include "mojo/shell/public/cpp/application_impl.h"
#include "mojo/shell/public/interfaces/application.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -31,7 +32,8 @@ class TestHelper {
explicit TestHelper(ApplicationDelegate* delegate);
~TestHelper();
- ApplicationImpl* application_impl() { return application_impl_.get(); }
+ Shell* shell() { return application_impl_.get(); }
+ std::string shell_url() { return url_; }
private:
// The application delegate used if GetApplicationDelegate is not overridden.
@@ -40,6 +42,8 @@ class TestHelper {
// The application implementation instance, reconstructed for each test.
scoped_ptr<ApplicationImpl> application_impl_;
+ std::string url_;
+
MOJO_DISALLOW_COPY_AND_ASSIGN(TestHelper);
};
@@ -50,8 +54,11 @@ class ApplicationTestBase : public testing::Test {
~ApplicationTestBase() override;
protected:
- ApplicationImpl* application_impl() {
- return test_helper_ ? test_helper_->application_impl() : nullptr;
+ Shell* shell() {
+ return test_helper_ ? test_helper_->shell() : nullptr;
+ }
+ std::string shell_url() const {
+ return test_helper_ ? test_helper_->shell_url() : std::string();
}
// Get the ApplicationDelegate for the application to be tested.
« no previous file with comments | « mojo/shell/public/cpp/application_impl.h ('k') | mojo/shell/public/cpp/lib/application_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698