OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/drive/drive_file_system.h" | 5 #include "chrome/browser/chromeos/drive/drive_file_system.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1979 | 1979 |
1980 TEST_F(DriveFileSystemTest, ContentSearchWithNewEntry) { | 1980 TEST_F(DriveFileSystemTest, ContentSearchWithNewEntry) { |
1981 ASSERT_TRUE(LoadRootFeedDocument()); | 1981 ASSERT_TRUE(LoadRootFeedDocument()); |
1982 | 1982 |
1983 // Create a new directory in the drive service. | 1983 // Create a new directory in the drive service. |
1984 google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR; | 1984 google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR; |
1985 scoped_ptr<google_apis::ResourceEntry> resource_entry; | 1985 scoped_ptr<google_apis::ResourceEntry> resource_entry; |
1986 fake_drive_service_->AddNewDirectory( | 1986 fake_drive_service_->AddNewDirectory( |
1987 fake_drive_service_->GetRootResourceId(), // Add to the root directory. | 1987 fake_drive_service_->GetRootResourceId(), // Add to the root directory. |
1988 "New Directory 1!", | 1988 "New Directory 1!", |
1989 base::Bind( | 1989 google_apis::test_util::CreateCopyResultCallback( |
1990 &google_apis::test_util::CopyResultsFromGetResourceEntryCallback, | 1990 &error, &resource_entry)); |
1991 &error, | |
1992 &resource_entry)); | |
1993 message_loop_.RunUntilIdle(); | 1991 message_loop_.RunUntilIdle(); |
1994 | 1992 |
1995 // As the result of the first Search(), only entries in the current file | 1993 // As the result of the first Search(), only entries in the current file |
1996 // system snapshot are expected to be returned (i.e. "New Directory 1!" | 1994 // system snapshot are expected to be returned (i.e. "New Directory 1!" |
1997 // shouldn't be included in the search result even though it matches | 1995 // shouldn't be included in the search result even though it matches |
1998 // "Directory 1". | 1996 // "Directory 1". |
1999 const SearchResultPair kExpectedResults[] = { | 1997 const SearchResultPair kExpectedResults[] = { |
2000 { "drive/Directory 1", true } | 1998 { "drive/Directory 1", true } |
2001 }; | 1999 }; |
2002 | 2000 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2175 | 2173 |
2176 // An app for foo.exe should now be found, as the registry was loaded. | 2174 // An app for foo.exe should now be found, as the registry was loaded. |
2177 drive_webapps_registry_->GetWebAppsForFile( | 2175 drive_webapps_registry_->GetWebAppsForFile( |
2178 base::FilePath(FILE_PATH_LITERAL("foo.exe")), | 2176 base::FilePath(FILE_PATH_LITERAL("foo.exe")), |
2179 "" /* mime_type */, | 2177 "" /* mime_type */, |
2180 &apps); | 2178 &apps); |
2181 EXPECT_EQ(1U, apps.size()); | 2179 EXPECT_EQ(1U, apps.size()); |
2182 } | 2180 } |
2183 | 2181 |
2184 } // namespace drive | 2182 } // namespace drive |
OLD | NEW |