summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/convert_user_script_unittest.cc
diff options
context:
space:
mode:
authorRDevlin.Cronin@gmail.com <RDevlin.Cronin@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-17 09:33:49 +0000
committerRDevlin.Cronin@gmail.com <RDevlin.Cronin@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-17 09:33:49 +0000
commitfc670829eda3698d0385e1d6cffd4a5b63128383 (patch)
tree33f34d0aee29dc1caa17bfb0d07a3f842ccbb0ab /chrome/browser/extensions/convert_user_script_unittest.cc
parent1d1b4a34f25746bb8d645051bf5aedff31781c0f (diff)
downloadchromium_src-fc670829eda3698d0385e1d6cffd4a5b63128383.zip
chromium_src-fc670829eda3698d0385e1d6cffd4a5b63128383.tar.gz
chromium_src-fc670829eda3698d0385e1d6cffd4a5b63128383.tar.bz2
Updating extensions code to use UTF16
Changes std::string error to string16 in various locations of the Extensions file, spanning up the tree from ExtensionErrorReporter and Extension::InitFromValue, with conversion to string16 beginning at extension_l10n_util::LocalizeExtension and Extension::Create. Later patches can continue/expand the conversion. BUG=71980 TEST=Run existing unit tests and browser tests, which have been adjusted for string16s. Review URL: http://codereview.chromium.org/8890086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114917 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/convert_user_script_unittest.cc')
-rw-r--r--chrome/browser/extensions/convert_user_script_unittest.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/chrome/browser/extensions/convert_user_script_unittest.cc b/chrome/browser/extensions/convert_user_script_unittest.cc
index 38b106a..a11056e 100644
--- a/chrome/browser/extensions/convert_user_script_unittest.cc
+++ b/chrome/browser/extensions/convert_user_script_unittest.cc
@@ -10,6 +10,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/path_service.h"
#include "base/scoped_temp_dir.h"
+#include "base/utf_string_conversions.h"
#include "chrome/browser/extensions/convert_user_script.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/extension.h"
@@ -30,12 +31,12 @@ TEST(ExtensionFromUserScript, Basic) {
test_file = test_file.AppendASCII("extensions")
.AppendASCII("user_script_basic.user.js");
- std::string error;
+ string16 error;
scoped_refptr<Extension> extension(ConvertUserScriptToExtension(
test_file, GURL("http://www.google.com/foo"), &error));
ASSERT_TRUE(extension.get());
- EXPECT_EQ("", error);
+ EXPECT_EQ(ASCIIToUTF16(""), error);
// Use a temp dir so that the extensions dir will clean itself up.
ScopedTempDir ext_dir;
@@ -73,12 +74,12 @@ TEST(ExtensionFromUserScript, NoMetdata) {
test_file = test_file.AppendASCII("extensions")
.AppendASCII("user_script_no_metadata.user.js");
- std::string error;
+ string16 error;
scoped_refptr<Extension> extension(ConvertUserScriptToExtension(
test_file, GURL("http://www.google.com/foo/bar.user.js?monkey"), &error));
ASSERT_TRUE(extension.get());
- EXPECT_EQ("", error);
+ EXPECT_EQ(ASCIIToUTF16(""), error);
// Use a temp dir so that the extensions dir will clean itself up.
ScopedTempDir ext_dir;
@@ -116,12 +117,12 @@ TEST(ExtensionFromUserScript, NotUTF8) {
test_file = test_file.AppendASCII("extensions")
.AppendASCII("user_script_not_utf8.user.js");
- std::string error;
+ string16 error;
scoped_refptr<Extension> extension(ConvertUserScriptToExtension(
test_file, GURL("http://www.google.com/foo/bar.user.js?monkey"), &error));
ASSERT_FALSE(extension.get());
- EXPECT_EQ("User script must be UTF8 encoded.", error);
+ EXPECT_EQ(ASCIIToUTF16("User script must be UTF8 encoded."), error);
}
TEST(ExtensionFromUserScript, RunAtDocumentStart) {
@@ -130,12 +131,12 @@ TEST(ExtensionFromUserScript, RunAtDocumentStart) {
test_file = test_file.AppendASCII("extensions")
.AppendASCII("user_script_run_at_start.user.js");
- std::string error;
+ string16 error;
scoped_refptr<Extension> extension(ConvertUserScriptToExtension(
test_file, GURL("http://www.google.com/foo"), &error));
ASSERT_TRUE(extension.get());
- EXPECT_EQ("", error);
+ EXPECT_EQ(ASCIIToUTF16(""), error);
// Use a temp dir so that the extensions dir will clean itself up.
ScopedTempDir ext_dir;
@@ -159,12 +160,12 @@ TEST(ExtensionFromUserScript, RunAtDocumentEnd) {
test_file = test_file.AppendASCII("extensions")
.AppendASCII("user_script_run_at_end.user.js");
- std::string error;
+ string16 error;
scoped_refptr<Extension> extension(ConvertUserScriptToExtension(
test_file, GURL("http://www.google.com/foo"), &error));
ASSERT_TRUE(extension.get());
- EXPECT_EQ("", error);
+ EXPECT_EQ(ASCIIToUTF16(""), error);
// Use a temp dir so that the extensions dir will clean itself up.
ScopedTempDir ext_dir;
@@ -189,12 +190,12 @@ TEST(ExtensionFromUserScript, RunAtDocumentIdle) {
.AppendASCII("user_script_run_at_idle.user.js");
ASSERT_TRUE(file_util::PathExists(test_file)) << test_file.value();
- std::string error;
+ string16 error;
scoped_refptr<Extension> extension(ConvertUserScriptToExtension(
test_file, GURL("http://www.google.com/foo"), &error));
ASSERT_TRUE(extension.get());
- EXPECT_EQ("", error);
+ EXPECT_EQ(ASCIIToUTF16(""), error);
// Use a temp dir so that the extensions dir will clean itself up.
ScopedTempDir ext_dir;