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

Unified Diff: content/browser/webui/web_ui_mojo_browsertest.cc

Issue 2008383002: Remove a bunch of stuff in //mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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 | « components/leveldb/remote_iterator_unittest.cc ('k') | content/content_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/webui/web_ui_mojo_browsertest.cc
diff --git a/content/browser/webui/web_ui_mojo_browsertest.cc b/content/browser/webui/web_ui_mojo_browsertest.cc
index 5edfb2c3ff4f71e0d4fbb4b18012943ae009f806..f1d002e32a12c974088354dbbb506c3a7552af68 100644
--- a/content/browser/webui/web_ui_mojo_browsertest.cc
+++ b/content/browser/webui/web_ui_mojo_browsertest.cc
@@ -31,12 +31,21 @@
#include "content/test/data/web_ui_test_mojo_bindings.mojom.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/bindings/interface_request.h"
-#include "mojo/test/test_utils.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
namespace content {
namespace {
+base::FilePath GetFilePathForJSResource(const std::string& path) {
+ std::string binding_path = "gen/" + path + ".js";
+#if defined(OS_WIN)
+ base::ReplaceChars(binding_path, "//", "\\", &binding_path);
+#endif
+ base::FilePath exe_dir;
+ PathService::Get(base::DIR_EXE, &exe_dir);
+ return exe_dir.AppendASCII(binding_path);
+}
+
bool got_message = false;
// The bindings for the page are generated from a .mojom file. This code looks
@@ -45,8 +54,7 @@ bool GetResource(const std::string& id,
const WebUIDataSource::GotDataCallback& callback) {
if (id.find(".mojom") != std::string::npos) {
std::string contents;
- CHECK(base::ReadFileToString(mojo::test::GetFilePathForJSResource(id),
- &contents))
+ CHECK(base::ReadFileToString(GetFilePathForJSResource(id), &contents))
<< id;
base::RefCountedString* ref_contents = new base::RefCountedString;
ref_contents->data() = contents;
@@ -189,8 +197,7 @@ bool IsGeneratedResourceAvailable(const std::string& resource_path) {
// files. If the bindings file doesn't exist assume we're on such a bot and
// pass.
// TODO(sky): remove this conditional when isolates support copying from gen.
- const base::FilePath test_file_path(
- mojo::test::GetFilePathForJSResource(resource_path));
+ const base::FilePath test_file_path(GetFilePathForJSResource(resource_path));
if (base::PathExists(test_file_path))
return true;
LOG(WARNING) << " mojom binding file doesn't exist, assuming on isolate";
« no previous file with comments | « components/leveldb/remote_iterator_unittest.cc ('k') | content/content_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698