summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extensions_service_unittest.cc
diff options
context:
space:
mode:
authormad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-20 15:27:21 +0000
committermad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-20 15:27:21 +0000
commit9194b3fc91953bb1472d8671d2322ac5616ee0b4 (patch)
treed9d60fc09ec8dc5ad6fb65499ad5bcce1d06de0f /chrome/browser/extensions/extensions_service_unittest.cc
parenta4dc33f2e485e586cc3fb03142c2800249fe9ced (diff)
downloadchromium_src-9194b3fc91953bb1472d8671d2322ac5616ee0b4.zip
chromium_src-9194b3fc91953bb1472d8671d2322ac5616ee0b4.tar.gz
chromium_src-9194b3fc91953bb1472d8671d2322ac5616ee0b4.tar.bz2
Minimize dependency of user scripts.
And made some minor lint fixes and code refactoring on the way, based on CR comments of previous attempt. BUG=none TEST=Make sure that the extension resources can still be properly localized and that they also load correctly when they are not localized. Review URL: http://codereview.chromium.org/267051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29512 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extensions_service_unittest.cc')
-rw-r--r--chrome/browser/extensions/extensions_service_unittest.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/chrome/browser/extensions/extensions_service_unittest.cc b/chrome/browser/extensions/extensions_service_unittest.cc
index f1a1ede..afadd3c 100644
--- a/chrome/browser/extensions/extensions_service_unittest.cc
+++ b/chrome/browser/extensions/extensions_service_unittest.cc
@@ -540,14 +540,20 @@ TEST_F(ExtensionsServiceTest, LoadAllExtensionsFromDirectorySuccess) {
EXPECT_EQ("https://*.google.com/*",
scripts[0].url_patterns()[2].GetAsString());
EXPECT_EQ(2u, scripts[0].js_scripts().size());
- EXPECT_TRUE(scripts[0].js_scripts()[0].resource().ComparePathWithDefault(
+ 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")));
- EXPECT_TRUE(scripts[0].js_scripts()[1].resource().ComparePathWithDefault(
+ 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")));
EXPECT_TRUE(extension->plugins().empty());
EXPECT_EQ(1u, scripts[1].url_patterns().size());
EXPECT_EQ("http://*.news.com/*", scripts[1].url_patterns()[0].GetAsString());
- EXPECT_TRUE(scripts[1].js_scripts()[0].resource().ComparePathWithDefault(
+ 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")));
const std::vector<URLPattern> permissions = extension->host_permissions();
ASSERT_EQ(2u, permissions.size());