summaryrefslogtreecommitdiffstats
path: root/chrome/test/automation
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-24 20:59:09 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-24 20:59:09 +0000
commit70c209d8418a49a809eddab94b8816d47a93bfd8 (patch)
tree44eaa7de2227c288ec3098cb11a87d632505cdea /chrome/test/automation
parentd8dca13dc0b5218a0f4387b76cd8d4952e9b66f5 (diff)
downloadchromium_src-70c209d8418a49a809eddab94b8816d47a93bfd8.zip
chromium_src-70c209d8418a49a809eddab94b8816d47a93bfd8.tar.gz
chromium_src-70c209d8418a49a809eddab94b8816d47a93bfd8.tar.bz2
Revert 72380 - Remove wstring from autocomplete.
BUG=23581 TEST=no visible changes; all tests pass Review URL: http://codereview.chromium.org/6258015 TBR=avi@chromium.org Review URL: http://codereview.chromium.org/6256010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72385 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation')
-rw-r--r--chrome/test/automation/autocomplete_edit_proxy.cc4
-rw-r--r--chrome/test/automation/autocomplete_edit_proxy.h22
-rw-r--r--chrome/test/automation/automation_proxy_uitest.cc18
3 files changed, 21 insertions, 23 deletions
diff --git a/chrome/test/automation/autocomplete_edit_proxy.cc b/chrome/test/automation/autocomplete_edit_proxy.cc
index fc5871a..fd8061b 100644
--- a/chrome/test/automation/autocomplete_edit_proxy.cc
+++ b/chrome/test/automation/autocomplete_edit_proxy.cc
@@ -14,7 +14,7 @@
using base::TimeDelta;
using base::TimeTicks;
-bool AutocompleteEditProxy::GetText(string16* text) const {
+bool AutocompleteEditProxy::GetText(std::wstring* text) const {
if (!is_valid())
return false;
if (!text) {
@@ -36,7 +36,7 @@ bool AutocompleteEditProxy::WaitForFocus() const {
return edit_exists;
}
-bool AutocompleteEditProxy::SetText(const string16& text) {
+bool AutocompleteEditProxy::SetText(const std::wstring& text) {
if (!is_valid())
return false;
bool result = false;
diff --git a/chrome/test/automation/autocomplete_edit_proxy.h b/chrome/test/automation/autocomplete_edit_proxy.h
index 73dc673..e33824a 100644
--- a/chrome/test/automation/autocomplete_edit_proxy.h
+++ b/chrome/test/automation/autocomplete_edit_proxy.h
@@ -48,11 +48,11 @@ struct AutocompleteMatchData {
std::string provider_name;
int relevance;
bool deletable;
- string16 fill_into_edit;
+ std::wstring fill_into_edit;
size_t inline_autocomplete_offset;
GURL destination_url;
- string16 contents;
- string16 description;
+ std::wstring contents;
+ std::wstring description;
bool is_history_what_you_typed_match;
std::string type;
bool starred;
@@ -68,11 +68,11 @@ struct ParamTraits<AutocompleteMatchData> {
m->WriteString(p.provider_name);
m->WriteInt(p.relevance);
m->WriteBool(p.deletable);
- m->WriteString16(p.fill_into_edit);
+ m->WriteWString(p.fill_into_edit);
m->WriteSize(p.inline_autocomplete_offset);
m->WriteString(p.destination_url.possibly_invalid_spec());
- m->WriteString16(p.contents);
- m->WriteString16(p.description);
+ m->WriteWString(p.contents);
+ m->WriteWString(p.description);
m->WriteBool(p.is_history_what_you_typed_match);
m->WriteString(p.type);
m->WriteBool(p.starred);
@@ -83,11 +83,11 @@ struct ParamTraits<AutocompleteMatchData> {
if (!m->ReadString(iter, &r->provider_name) ||
!m->ReadInt(iter, &r->relevance) ||
!m->ReadBool(iter, &r->deletable) ||
- !m->ReadString16(iter, &r->fill_into_edit) ||
+ !m->ReadWString(iter, &r->fill_into_edit) ||
!m->ReadSize(iter, &r->inline_autocomplete_offset) ||
!m->ReadString(iter, &destination_url) ||
- !m->ReadString16(iter, &r->contents) ||
- !m->ReadString16(iter, &r->description) ||
+ !m->ReadWString(iter, &r->contents) ||
+ !m->ReadWString(iter, &r->description) ||
!m->ReadBool(iter, &r->is_history_what_you_typed_match) ||
!m->ReadString(iter, &r->type) ||
!m->ReadBool(iter, &r->starred))
@@ -136,10 +136,10 @@ class AutocompleteEditProxy : public AutomationResourceProxy {
// there are no IPC errors.
// Gets the text visible in the omnibox.
- bool GetText(string16* text) const;
+ bool GetText(std::wstring* text) const;
// Sets the text visible in the omnibox.
- bool SetText(const string16& text);
+ bool SetText(const std::wstring& text);
// Determines if a query to an autocomplete provider is still in progress.
// NOTE: No autocomplete queries will be made if the omnibox doesn't have
diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc
index b465b07..bd9cef0 100644
--- a/chrome/test/automation/automation_proxy_uitest.cc
+++ b/chrome/test/automation/automation_proxy_uitest.cc
@@ -1384,8 +1384,8 @@ TEST_F(AutomationProxyTest, AutocompleteGetSetText) {
browser->GetAutocompleteEdit());
ASSERT_TRUE(edit.get());
EXPECT_TRUE(edit->is_valid());
- const string16 text_to_set = ASCIIToUTF16("Lollerskates");
- string16 actual_text;
+ const std::wstring text_to_set = L"Lollerskates";
+ std::wstring actual_text;
EXPECT_TRUE(edit->SetText(text_to_set));
EXPECT_TRUE(edit->GetText(&actual_text));
EXPECT_EQ(text_to_set, actual_text);
@@ -1409,9 +1409,9 @@ TEST_F(AutomationProxyTest, AutocompleteParallelProxy) {
ASSERT_TRUE(edit2.get());
EXPECT_TRUE(browser2->GetTab(0)->WaitForTabToBeRestored(
TestTimeouts::action_max_timeout_ms()));
- const string16 text_to_set1 = ASCIIToUTF16("Lollerskates");
- const string16 text_to_set2 = ASCIIToUTF16("Roflcopter");
- string16 actual_text1, actual_text2;
+ const std::wstring text_to_set1 = L"Lollerskates";
+ const std::wstring text_to_set2 = L"Roflcopter";
+ std::wstring actual_text1, actual_text2;
EXPECT_TRUE(edit1->SetText(text_to_set1));
EXPECT_TRUE(edit2->SetText(text_to_set2));
EXPECT_TRUE(edit1->GetText(&actual_text1));
@@ -1438,7 +1438,7 @@ TEST_F(AutomationProxyVisibleTest, AutocompleteMatchesTest) {
EXPECT_TRUE(edit->is_valid());
EXPECT_TRUE(browser->ApplyAccelerator(IDC_FOCUS_LOCATION));
ASSERT_TRUE(edit->WaitForFocus());
- EXPECT_TRUE(edit->SetText(ASCIIToUTF16("Roflcopter")));
+ EXPECT_TRUE(edit->SetText(L"Roflcopter"));
EXPECT_TRUE(edit->WaitForQuery(TestTimeouts::action_max_timeout_ms()));
bool query_in_progress;
EXPECT_TRUE(edit->IsQueryInProgress(&query_in_progress));
@@ -1513,8 +1513,7 @@ TEST_F(AutomationProxyTest, FLAKY_AppModalDialogTest) {
EXPECT_FALSE(modal_dialog_showing);
int result = -1;
EXPECT_TRUE(tab->ExecuteAndExtractInt(
- std::wstring(),
- L"window.domAutomationController.send(result);", &result));
+ L"", L"window.domAutomationController.send(result);", &result));
EXPECT_EQ(0, result);
// Try again.
@@ -1534,8 +1533,7 @@ TEST_F(AutomationProxyTest, FLAKY_AppModalDialogTest) {
&button));
EXPECT_FALSE(modal_dialog_showing);
EXPECT_TRUE(tab->ExecuteAndExtractInt(
- std::wstring(),
- L"window.domAutomationController.send(result);", &result));
+ L"", L"window.domAutomationController.send(result);", &result));
EXPECT_EQ(1, result);
}