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

Unified Diff: chrome/browser/chromeos/drive/search_metadata_unittest.cc

Issue 14366010: drive: Fix a bug where special directories are suggested from autocomplete (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
« no previous file with comments | « chrome/browser/chromeos/drive/search_metadata.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/search_metadata_unittest.cc
diff --git a/chrome/browser/chromeos/drive/search_metadata_unittest.cc b/chrome/browser/chromeos/drive/search_metadata_unittest.cc
index 1ddb955da2df1503a968213ab9af42eaf7200ea7..f00e18949370f76b79421644aec49610619191d7 100644
--- a/chrome/browser/chromeos/drive/search_metadata_unittest.cc
+++ b/chrome/browser/chromeos/drive/search_metadata_unittest.cc
@@ -325,6 +325,27 @@ TEST_F(SearchMetadataTest, SearchMetadata_ExcludeDirectory) {
result->at(0).path.AsUTF8Unsafe());
}
+// "drive", "drive/root", "drive/other" should be excluded.
+TEST_F(SearchMetadataTest, SearchMetadata_ExcludeSpecialDirectories) {
+ const char* kQueries[] = { "drive", "root", "other" };
+ for (size_t i = 0; i < arraysize(kQueries); ++i) {
+ DriveFileError error = DRIVE_FILE_ERROR_FAILED;
+ scoped_ptr<MetadataSearchResultVector> result;
+
+ const std::string query = kQueries[i];
+ SearchMetadata(resource_metadata_.get(),
+ query,
+ SEARCH_METADATA_ALL,
+ kDefaultAtMostNumMatches,
+ google_apis::test_util::CreateCopyResultCallback(
+ &error, &result));
+
+ google_apis::test_util::RunBlockingPoolTask();
+ EXPECT_EQ(DRIVE_FILE_OK, error);
+ ASSERT_TRUE(result->empty()) << ": " << query << " should not match";
+ }
+}
+
TEST(SearchMetadataSimpleTest, FindAndHighlight_ZeroMatches) {
std::string highlighted_text;
EXPECT_FALSE(FindAndHighlight("text", "query", &highlighted_text));
« no previous file with comments | « chrome/browser/chromeos/drive/search_metadata.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698