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

Unified Diff: mojo/shell/standalone/shell_apptest.cc

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/standalone/context.cc ('k') | mojo/shell/standalone/test/pingable_app.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/standalone/shell_apptest.cc
diff --git a/mojo/shell/standalone/shell_apptest.cc b/mojo/shell/standalone/shell_apptest.cc
index a8a5c5ba65167f31fc3e5b2bd577303210a59e10..2ded9989d86f108fe7d9aea9bbccc5f4944f16ca 100644
--- a/mojo/shell/standalone/shell_apptest.cc
+++ b/mojo/shell/standalone/shell_apptest.cc
@@ -18,8 +18,8 @@
#include "mojo/services/http_server/public/interfaces/http_server.mojom.h"
#include "mojo/services/http_server/public/interfaces/http_server_factory.mojom.h"
#include "mojo/services/network/public/interfaces/net_address.mojom.h"
-#include "mojo/shell/public/cpp/application_impl.h"
#include "mojo/shell/public/cpp/application_test_base.h"
+#include "mojo/shell/public/cpp/shell.h"
#include "mojo/shell/standalone/kPingable.h"
#include "mojo/shell/standalone/test/pingable.mojom.h"
@@ -77,8 +77,7 @@ class ShellHTTPAppTest : public test::ApplicationTestBase {
void SetUp() override {
ApplicationTestBase::SetUp();
- application_impl()->ConnectToService("mojo:http_server",
- &http_server_factory_);
+ shell()->ConnectToService("mojo:http_server", &http_server_factory_);
NetAddressPtr local_address(NetAddress::New());
local_address->family = NET_ADDRESS_FAMILY_IPV4;
@@ -118,7 +117,7 @@ class ShellHTTPAppTest : public test::ApplicationTestBase {
// Test that we can load apps over http.
TEST_F(ShellHTTPAppTest, Http) {
InterfacePtr<Pingable> pingable;
- application_impl()->ConnectToService(GetURL("app"), &pingable);
+ shell()->ConnectToService(GetURL("app"), &pingable);
pingable->Ping("hello",
[this](const String& app_url, const String& connection_url,
const String& message) {
@@ -134,7 +133,7 @@ TEST_F(ShellHTTPAppTest, Http) {
// TODO(aa): Test that apps receive the correct URL parameters.
TEST_F(ShellHTTPAppTest, Redirect) {
InterfacePtr<Pingable> pingable;
- application_impl()->ConnectToService(GetURL("redirect"), &pingable);
+ shell()->ConnectToService(GetURL("redirect"), &pingable);
pingable->Ping("hello",
[this](const String& app_url, const String& connection_url,
const String& message) {
@@ -156,8 +155,8 @@ TEST_F(ShellHTTPAppTest, Redirect) {
TEST_F(ShellHTTPAppTest, MAYBE_QueryHandling) {
InterfacePtr<Pingable> pingable1;
InterfacePtr<Pingable> pingable2;
- application_impl()->ConnectToService(GetURL("app?foo"), &pingable1);
- application_impl()->ConnectToService(GetURL("app?bar"), &pingable2);
+ shell()->ConnectToService(GetURL("app?foo"), &pingable1);
+ shell()->ConnectToService(GetURL("app?bar"), &pingable2);
int num_responses = 0;
auto callback = [this, &num_responses](const String& app_url,
@@ -183,7 +182,7 @@ TEST_F(ShellHTTPAppTest, MAYBE_QueryHandling) {
// mojo: URLs can have querystrings too
TEST_F(ShellAppTest, MojoURLQueryHandling) {
InterfacePtr<Pingable> pingable;
- application_impl()->ConnectToService("mojo:pingable_app?foo", &pingable);
+ shell()->ConnectToService("mojo:pingable_app?foo", &pingable);
auto callback = [this](const String& app_url, const String& connection_url,
const String& message) {
EXPECT_TRUE(base::EndsWith(app_url, "/pingable_app.mojo",
« no previous file with comments | « mojo/shell/standalone/context.cc ('k') | mojo/shell/standalone/test/pingable_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698