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

Unified Diff: components/resource_provider/file_utils_unittest.cc

Issue 1743473002: Change Mojo URLs to structured names (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@18collapse
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 | « components/resource_provider/file_utils.cc ('k') | components/resource_provider/manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/resource_provider/file_utils_unittest.cc
diff --git a/components/resource_provider/file_utils_unittest.cc b/components/resource_provider/file_utils_unittest.cc
index 914eddda8135375ec17e19f730db5d507b405675..8ee1200cf2b3e3f22b03331c8248e122a00edb59 100644
--- a/components/resource_provider/file_utils_unittest.cc
+++ b/components/resource_provider/file_utils_unittest.cc
@@ -11,28 +11,27 @@
#include "base/path_service.h"
#include "base/strings/string_util.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "url/gurl.h"
namespace resource_provider {
// Assertions for invalid app paths.
TEST(FileUtilsTest, InvalidAppPath) {
struct TestCase {
- std::string url;
+ std::string name;
};
struct TestCase invalid_cases[]{
{"http://foo"}, // Must start with 'mojo:'.
- {"mojo://."}, // Don't allow '.'.
- {"mojo://.."}, // Don't allow '..'.
- {"mojo://foo/."}, // Don't allow '.'.
- {"mojo://bar/.."}, // Don't allow '..'.
+ {"mojo:."}, // Don't allow '.'.
+ {"mojo:.."}, // Don't allow '..'.
+ {"mojo:foo/."}, // Don't allow '.'.
+ {"mojo:bar/.."}, // Don't allow '..'.
};
for (size_t i = 0; i < arraysize(invalid_cases); ++i) {
- base::FilePath resulting_path(GetPathForApplicationUrl(
- invalid_cases[i].url));
+ base::FilePath resulting_path(GetPathForApplicationName(
+ invalid_cases[i].name));
EXPECT_TRUE(resulting_path.empty()) << "i=" << i
- << " input=" << invalid_cases[i].url
+ << " input=" << invalid_cases[i].name
<< " result=" << resulting_path.value();
}
}
@@ -53,7 +52,7 @@ TEST(FileUtilsTest, InvalidResourcePath) {
{"bar//baz/"},
};
- const base::FilePath app_path(GetPathForApplicationUrl("mojo:test"));
+ const base::FilePath app_path(GetPathForApplicationName("mojo:test"));
ASSERT_FALSE(app_path.empty());
for (size_t i = 0; i < arraysize(invalid_cases); ++i) {
@@ -66,7 +65,7 @@ TEST(FileUtilsTest, InvalidResourcePath) {
}
TEST(FileUtilsTest, ValidPaths) {
- const base::FilePath app_path(GetPathForApplicationUrl("mojo:test"));
+ const base::FilePath app_path(GetPathForApplicationName("mojo:test"));
ASSERT_FALSE(app_path.empty());
// Trivial single path element.
« no previous file with comments | « components/resource_provider/file_utils.cc ('k') | components/resource_provider/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698