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

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

Issue 8890086: Issue 71980: Extensions code should use UTF-16 for user-visible Unicode strings (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years 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 | « chrome/browser/extensions/convert_user_script.cc ('k') | chrome/browser/extensions/crx_installer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/convert_user_script_unittest.cc
===================================================================
--- chrome/browser/extensions/convert_user_script_unittest.cc (revision 114888)
+++ chrome/browser/extensions/convert_user_script_unittest.cc (working copy)
@@ -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_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_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_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_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_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 @@
.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;
« no previous file with comments | « chrome/browser/extensions/convert_user_script.cc ('k') | chrome/browser/extensions/crx_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698