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

Unified Diff: chrome/browser/webdata/web_data_service_unittest.cc

Issue 8417043: Add webkit_glue namespace. Improve some variable and test names. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 months 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
Index: chrome/browser/webdata/web_data_service_unittest.cc
diff --git a/chrome/browser/webdata/web_data_service_unittest.cc b/chrome/browser/webdata/web_data_service_unittest.cc
index 4f3ecacdc494e55cdadb8cf7cc788368a17eaca7..5be9751a2e910478af03c60328c6af1895c6f354 100644
--- a/chrome/browser/webdata/web_data_service_unittest.cc
+++ b/chrome/browser/webdata/web_data_service_unittest.cc
@@ -43,6 +43,7 @@ using testing::DoDefault;
using testing::ElementsAreArray;
using testing::Pointee;
using testing::Property;
+using webkit_glue::WebIntentServiceData;
typedef std::vector<AutofillChange> AutofillChangeList;
@@ -150,10 +151,10 @@ class WebIntentsConsumer: public WebDataServiceConsumer {
public:
virtual void OnWebDataServiceRequestDone(WebDataService::Handle h,
const WDTypedResult* result) {
- intents.clear();
+ services.clear();
if (result) {
DCHECK(result->GetType() == WEB_INTENTS_RESULT);
- intents = static_cast<
+ services = static_cast<
const WDResult<std::vector<WebIntentServiceData> >*>(result)->
GetValue();
}
@@ -170,7 +171,7 @@ class WebIntentsConsumer: public WebDataServiceConsumer {
}
// Result data from completion callback.
- std::vector<WebIntentServiceData> intents;
+ std::vector<WebIntentServiceData> services;
groby-ooo-7-16 2011/10/31 20:53:37 nit: should be services_
Greg Billock 2011/11/01 17:11:17 Done.
};
TEST_F(WebDataServiceAutofillTest, FormFillAdd) {
@@ -601,7 +602,7 @@ TEST_F(WebDataServiceTest, WebIntents) {
wds_->GetWebIntents(ASCIIToUTF16("share"), &consumer);
WebIntentsConsumer::WaitUntilCalled();
- EXPECT_EQ(0U, consumer.intents.size());
+ EXPECT_EQ(0U, consumer.services.size());
WebIntentServiceData service;
service.service_url = GURL("http://google.com");
@@ -614,29 +615,29 @@ TEST_F(WebDataServiceTest, WebIntents) {
wds_->GetWebIntents(ASCIIToUTF16("share"), &consumer);
WebIntentsConsumer::WaitUntilCalled();
- ASSERT_EQ(2U, consumer.intents.size());
+ ASSERT_EQ(2U, consumer.services.size());
- if (consumer.intents[0].type != ASCIIToUTF16("image/*"))
- std::swap(consumer.intents[0],consumer.intents[1]);
+ if (consumer.services[0].type != ASCIIToUTF16("image/*"))
+ std::swap(consumer.services[0],consumer.services[1]);
- EXPECT_EQ(service.service_url, consumer.intents[0].service_url);
- EXPECT_EQ(service.action, consumer.intents[0].action);
- EXPECT_EQ(ASCIIToUTF16("image/*"), consumer.intents[0].type);
- EXPECT_EQ(service.service_url, consumer.intents[1].service_url);
- EXPECT_EQ(service.action, consumer.intents[1].action);
- EXPECT_EQ(service.type, consumer.intents[1].type);
+ EXPECT_EQ(service.service_url, consumer.services[0].service_url);
+ EXPECT_EQ(service.action, consumer.services[0].action);
+ EXPECT_EQ(ASCIIToUTF16("image/*"), consumer.services[0].type);
+ EXPECT_EQ(service.service_url, consumer.services[1].service_url);
+ EXPECT_EQ(service.action, consumer.services[1].action);
+ EXPECT_EQ(service.type, consumer.services[1].type);
service.type = ASCIIToUTF16("image/*");
wds_->RemoveWebIntent(service);
wds_->GetWebIntents(ASCIIToUTF16("share"), &consumer);
WebIntentsConsumer::WaitUntilCalled();
- ASSERT_EQ(1U, consumer.intents.size());
+ ASSERT_EQ(1U, consumer.services.size());
service.type = ASCIIToUTF16("video/*");
- EXPECT_EQ(service.service_url, consumer.intents[0].service_url);
- EXPECT_EQ(service.action, consumer.intents[0].action);
- EXPECT_EQ(service.type, consumer.intents[0].type);
+ EXPECT_EQ(service.service_url, consumer.services[0].service_url);
+ EXPECT_EQ(service.action, consumer.services[0].action);
+ EXPECT_EQ(service.type, consumer.services[0].type);
}
TEST_F(WebDataServiceTest, WebIntentsGetAll) {
@@ -653,12 +654,12 @@ TEST_F(WebDataServiceTest, WebIntentsGetAll) {
wds_->GetAllWebIntents(&consumer);
WebIntentsConsumer::WaitUntilCalled();
- ASSERT_EQ(2U, consumer.intents.size());
+ ASSERT_EQ(2U, consumer.services.size());
- if (consumer.intents[0].action != ASCIIToUTF16("edit"))
- std::swap(consumer.intents[0],consumer.intents[1]);
+ if (consumer.services[0].action != ASCIIToUTF16("edit"))
+ std::swap(consumer.services[0],consumer.services[1]);
- EXPECT_EQ(service, consumer.intents[0]);
+ EXPECT_EQ(service, consumer.services[0]);
service.action = ASCIIToUTF16("share");
- EXPECT_EQ(service, consumer.intents[1]);
+ EXPECT_EQ(service, consumer.services[1]);
}

Powered by Google App Engine
This is Rietveld 408576698