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

Unified Diff: shell/shell_apptest.cc

Issue 979043003: Fix shell_apptest for android. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: namespace Created 5 years, 9 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 | « shell/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/shell_apptest.cc
diff --git a/shell/shell_apptest.cc b/shell/shell_apptest.cc
index 30f4fd7689d82c147436646f9267d653a71f4204..7b610a737276233e9867072ea9564a40fc7fdeed 100644
--- a/shell/shell_apptest.cc
+++ b/shell/shell_apptest.cc
@@ -18,8 +18,8 @@
#include "services/http_server/public/http_server.mojom.h"
#include "services/http_server/public/http_server_factory.mojom.h"
#include "services/http_server/public/http_server_util.h"
+#include "shell/kPingable.h"
#include "shell/test/pingable.mojom.h"
-
namespace mojo {
namespace {
@@ -34,9 +34,6 @@ class GetHandler : public http_server::HttpHandler {
public:
GetHandler(InterfaceRequest<http_server::HttpHandler> request, uint16_t port)
: binding_(this, request.Pass()), port_(port) {
- CHECK(PathService::Get(base::FILE_MODULE, &app_path_));
- app_path_ = app_path_.DirName().Append("pingable_app.mojo");
- CHECK(base::PathExists(app_path_));
}
~GetHandler() override {}
@@ -47,10 +44,8 @@ class GetHandler : public http_server::HttpHandler {
const Callback<void(http_server::HttpResponsePtr)>& callback) override {
http_server::HttpResponsePtr response;
if (StartsWithASCII(request->relative_url, "/app", true)) {
- // Super inefficient, but meh.
- std::string data;
- base::ReadFileToString(app_path_, &data);
- response = http_server::CreateHttpResponse(200, data);
+ response = http_server::CreateHttpResponse(
+ 200, std::string(kPingable.data, kPingable.size));
response->content_type = "application/octet-stream";
} else if (request->relative_url == "/redirect") {
response = http_server::HttpResponse::New();
@@ -64,7 +59,6 @@ class GetHandler : public http_server::HttpHandler {
}
Binding<http_server::HttpHandler> binding_;
- base::FilePath app_path_;
uint16_t port_;
MOJO_DISALLOW_COPY_AND_ASSIGN(GetHandler);
@@ -120,10 +114,6 @@ class ShellHTTPAppTest : public test::ApplicationTestBase {
MOJO_DISALLOW_COPY_AND_ASSIGN(ShellHTTPAppTest);
};
-#if defined(OS_ANDROID)
-// These tests rely on data that needs to be bundled into the apptest binary in
-// order to work on Android.
-#else // !OS_ANDROID
// Test that we can load apps over http.
TEST_F(ShellHTTPAppTest, Http) {
InterfacePtr<Pingable> pingable;
@@ -188,7 +178,6 @@ TEST_F(ShellHTTPAppTest, MAYBE_QueryHandling) {
pingable2->Ping("hello", callback);
base::RunLoop().Run();
}
-#endif // OS_ANDROID
// mojo: URLs can have querystrings too
TEST_F(ShellAppTest, MojoURLQueryHandling) {
« no previous file with comments | « shell/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698