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

Unified Diff: chrome/browser/extensions/extensions_service_unittest.cc

Issue 343003: Get rid of FilePath::AppendAndResolveRelative().... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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
Index: chrome/browser/extensions/extensions_service_unittest.cc
===================================================================
--- chrome/browser/extensions/extensions_service_unittest.cc (revision 30231)
+++ chrome/browser/extensions/extensions_service_unittest.cc (working copy)
@@ -542,19 +542,23 @@
EXPECT_EQ(2u, scripts[0].js_scripts().size());
ExtensionResource resource00(scripts[0].js_scripts()[0].extension_root(),
scripts[0].js_scripts()[0].relative_path());
- EXPECT_TRUE(resource00.ComparePathWithDefault(
- extension->path().AppendASCII("script1.js")));
+ FilePath expected_path(extension->path().AppendASCII("script1.js"));
+ ASSERT_TRUE(file_util::AbsolutePath(&expected_path));
+ EXPECT_TRUE(resource00.ComparePathWithDefault(expected_path));
ExtensionResource resource01(scripts[0].js_scripts()[1].extension_root(),
scripts[0].js_scripts()[1].relative_path());
- EXPECT_TRUE(resource01.ComparePathWithDefault(
- extension->path().AppendASCII("script2.js")));
+ expected_path = extension->path().AppendASCII("script2.js");
+ ASSERT_TRUE(file_util::AbsolutePath(&expected_path));
+ EXPECT_TRUE(resource01.ComparePathWithDefault(expected_path));
EXPECT_TRUE(extension->plugins().empty());
EXPECT_EQ(1u, scripts[1].url_patterns().size());
EXPECT_EQ("http://*.news.com/*", scripts[1].url_patterns()[0].GetAsString());
ExtensionResource resource10(scripts[1].js_scripts()[0].extension_root(),
scripts[1].js_scripts()[0].relative_path());
- EXPECT_TRUE(resource10.ComparePathWithDefault(
- extension->path().AppendASCII("js_files").AppendASCII("script3.js")));
+ expected_path =
+ extension->path().AppendASCII("js_files").AppendASCII("script3.js");
+ ASSERT_TRUE(file_util::AbsolutePath(&expected_path));
+ EXPECT_TRUE(resource10.ComparePathWithDefault(expected_path));
const std::vector<URLPattern> permissions = extension->host_permissions();
ASSERT_EQ(2u, permissions.size());
EXPECT_EQ("http://*.google.com/*", permissions[0].GetAsString());

Powered by Google App Engine
This is Rietveld 408576698