summaryrefslogtreecommitdiffstats
path: root/webkit/glue/regular_expression_unittest.cc
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-01 22:31:35 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-01 22:31:35 +0000
commitde56f378336660dcc848763c80267a5e063ae47d (patch)
tree7f551b88923b35bc4022ce6ab3a3f602fb60d91c /webkit/glue/regular_expression_unittest.cc
parentdc4f63c80cb90efe594131030aad6776e5945fcc (diff)
downloadchromium_src-de56f378336660dcc848763c80267a5e063ae47d.zip
chromium_src-de56f378336660dcc848763c80267a5e063ae47d.tar.gz
chromium_src-de56f378336660dcc848763c80267a5e063ae47d.tar.bz2
Merge the chrome_webkit_merge_branch back on to trunk. This brings us
up to webkit@36102. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2778 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/regular_expression_unittest.cc')
-rw-r--r--webkit/glue/regular_expression_unittest.cc34
1 files changed, 17 insertions, 17 deletions
diff --git a/webkit/glue/regular_expression_unittest.cc b/webkit/glue/regular_expression_unittest.cc
index f3a319c..3e22ada 100644
--- a/webkit/glue/regular_expression_unittest.cc
+++ b/webkit/glue/regular_expression_unittest.cc
@@ -13,9 +13,9 @@
#include "webkit/glue/glue_util.h"
using std::wstring;
-using webkit_glue::StdWStringToDeprecatedString;
-using WebCore::DeprecatedString;
+using webkit_glue::StdWStringToString;
using WebCore::RegularExpression;
+using WebCore::String;
namespace {
@@ -32,14 +32,14 @@ struct Match {
TEST(RegexTest, Basic) {
// Just make sure we're not completely broken.
- const DeprecatedString pattern("the quick brown fox");
+ const String pattern("the quick brown fox");
RegularExpression regex(pattern, /* case sensitive */ true);
- EXPECT_EQ(0, regex.match(DeprecatedString("the quick brown fox")));
- EXPECT_EQ(1, regex.match(DeprecatedString(" the quick brown fox")));
- EXPECT_EQ(3, regex.match(DeprecatedString("foothe quick brown foxbar")));
+ EXPECT_EQ(0, regex.match("the quick brown fox"));
+ EXPECT_EQ(1, regex.match(" the quick brown fox"));
+ EXPECT_EQ(3, regex.match("foothe quick brown foxbar"));
- EXPECT_EQ(-1, regex.match(DeprecatedString("The quick brown FOX")));
- EXPECT_EQ(-1, regex.match(DeprecatedString("the quick brown fo")));
+ EXPECT_EQ(-1, regex.match("The quick brown FOX"));
+ EXPECT_EQ(-1, regex.match("the quick brown fo"));
}
TEST(RegexTest, Unicode) {
@@ -47,20 +47,20 @@ TEST(RegexTest, Unicode) {
// Test 1
wstring wstr_pattern(L"\x6240\x6709\x7f51\x9875");
- DeprecatedString pattern = StdWStringToDeprecatedString(wstr_pattern);
+ String pattern = StdWStringToString(wstr_pattern);
RegularExpression regex(pattern, /* case sensitive */ false);
- EXPECT_EQ(0, regex.match(StdWStringToDeprecatedString(wstr_pattern)));
- EXPECT_EQ(1, regex.match(StdWStringToDeprecatedString(
+ EXPECT_EQ(0, regex.match(StdWStringToString(wstr_pattern)));
+ EXPECT_EQ(1, regex.match(StdWStringToString(
wstring(L" ") + wstr_pattern)));
- EXPECT_EQ(3, regex.match(StdWStringToDeprecatedString(
+ EXPECT_EQ(3, regex.match(StdWStringToString(
wstring(L"foo") + wstr_pattern + wstring(L"bar"))));
- EXPECT_EQ(4, regex.match(StdWStringToDeprecatedString(
+ EXPECT_EQ(4, regex.match(StdWStringToString(
wstring(L"\x4e2d\x6587\x7f51\x9875") + wstr_pattern)));
// Test 2, mixed length
wstr_pattern = L":[ \x2000]+:";
- pattern = StdWStringToDeprecatedString(wstr_pattern);
+ pattern = StdWStringToString(wstr_pattern);
regex = RegularExpression(pattern, /* case sensitive */ false);
const Match matches[] = {
@@ -72,21 +72,21 @@ TEST(RegexTest, Unicode) {
{ L"::", -1, -1 },
};
for (size_t i = 0; i < arraysize(matches); ++i) {
- EXPECT_EQ(matches[i].position, regex.match(StdWStringToDeprecatedString(
+ EXPECT_EQ(matches[i].position, regex.match(StdWStringToString(
wstring(matches[i].text))));
EXPECT_EQ(matches[i].length, regex.matchedLength());
}
// Test 3, empty match
wstr_pattern = L"|x";
- pattern = StdWStringToDeprecatedString(wstr_pattern);
+ pattern = StdWStringToString(wstr_pattern);
regex = RegularExpression(pattern, /* case sensitive */ false);
const Match matches2[] = {
{ L"", 0, 0 },
};
for (size_t i = 0; i < arraysize(matches2); ++i) {
- EXPECT_EQ(matches2[i].position, regex.match(StdWStringToDeprecatedString(
+ EXPECT_EQ(matches2[i].position, regex.match(StdWStringToString(
wstring(matches2[i].text))));
EXPECT_EQ(matches2[i].length, regex.matchedLength());
}