Index: chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc |
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc b/chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc |
index 0bde982d61c433c6f6550938eb540e7a4dcdc964..8bb056f6f61d13475abb66cc85be7c4d6f3eb0bd 100644 |
--- a/chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc |
+++ b/chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc |
@@ -2427,6 +2427,36 @@ TEST_F(GDataFileSystemTest, ContentSearch) { |
message_loop_.Run(); // Wait to get our result. |
} |
+TEST_F(GDataFileSystemTest, ContentSearchWithNewEntry) { |
+ LoadRootFeedDocument("root_feed.json"); |
+ |
+ // Search result returning two entries "Directory 1/" and |
+ // "Directory 1/SubDirectory Newly Added File.txt". The latter is not |
+ // contained in the root feed. |
+ mock_doc_service_->set_search_result( |
+ "search_result_with_new_entry_feed.json"); |
+ |
+ EXPECT_CALL(*mock_doc_service_, GetDocuments(Eq(GURL()), _, "foo", _, _)) |
+ .Times(1); |
+ |
+ // Only entries in the current file system snapshot should be returned. |
satorux1
2012/07/31 20:48:52
I'm confused. I thought we wanted to include the n
satorux1
2012/07/31 20:50:23
Looking at the patch description, we don't need to
kinaba
2012/08/01 05:34:09
Done.
|
+ const SearchResultPair expected_results[] = { |
satorux1
2012/07/31 20:48:52
nit: kExpectedResults
kinaba
2012/08/01 05:34:09
Done.
|
+ { "drive/Directory 1", true } |
+ }; |
+ |
+ // Unknown entry should trigger delta feed request. |
+ EXPECT_CALL(*mock_doc_service_, GetAccountMetadata(_)).Times(1); |
+ EXPECT_CALL(*mock_doc_service_, GetDocuments(Eq(GURL()), _, "", _, _)) |
+ .Times(1); |
+ EXPECT_CALL(*mock_webapps_registry_, UpdateFromFeed(NotNull())).Times(1); |
+ |
+ SearchCallback callback = base::Bind(&DriveSearchCallback, |
+ &message_loop_, expected_results, 1u); |
satorux1
2012/07/31 20:48:52
1u -> ARRAYSIZE_UNSAFE(kExpectedResults)
kinaba
2012/08/01 05:34:09
Done.
|
+ |
+ file_system_->Search("foo", callback); |
+ message_loop_.Run(); // Wait to get our result. |
+} |
+ |
TEST_F(GDataFileSystemTest, ContentSearchEmptyResult) { |
LoadRootFeedDocument("root_feed.json"); |