OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/search_metadata.h" | 5 #include "chrome/browser/chromeos/drive/search_metadata.h" |
6 | 6 |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 FileError error = FILE_ERROR_FAILED; | 208 FileError error = FILE_ERROR_FAILED; |
209 base::FilePath drive_path; | 209 base::FilePath drive_path; |
210 | 210 |
211 resource_metadata_->AddEntryOnUIThread( | 211 resource_metadata_->AddEntryOnUIThread( |
212 entry, | 212 entry, |
213 google_apis::test_util::CreateCopyResultCallback(&error, &drive_path)); | 213 google_apis::test_util::CreateCopyResultCallback(&error, &drive_path)); |
214 google_apis::test_util::RunBlockingPoolTask(); | 214 google_apis::test_util::RunBlockingPoolTask(); |
215 EXPECT_EQ(FILE_ERROR_OK, error); | 215 EXPECT_EQ(FILE_ERROR_OK, error); |
216 } | 216 } |
217 | 217 |
218 MessageLoopForUI message_loop_; | 218 base::MessageLoopForUI message_loop_; |
219 content::TestBrowserThread ui_thread_; | 219 content::TestBrowserThread ui_thread_; |
220 base::ScopedTempDir temp_dir_; | 220 base::ScopedTempDir temp_dir_; |
221 scoped_ptr<FakeFreeDiskSpaceGetter> fake_free_disk_space_getter_; | 221 scoped_ptr<FakeFreeDiskSpaceGetter> fake_free_disk_space_getter_; |
222 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 222 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
223 scoped_ptr<ResourceMetadata, test_util::DestroyHelperForTests> | 223 scoped_ptr<ResourceMetadata, test_util::DestroyHelperForTests> |
224 resource_metadata_; | 224 resource_metadata_; |
225 scoped_ptr<internal::FileCache, test_util::DestroyHelperForTests> cache_; | 225 scoped_ptr<internal::FileCache, test_util::DestroyHelperForTests> cache_; |
226 }; | 226 }; |
227 | 227 |
228 TEST_F(SearchMetadataTest, SearchMetadata_ZeroMatches) { | 228 TEST_F(SearchMetadataTest, SearchMetadata_ZeroMatches) { |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 } | 613 } |
614 | 614 |
615 TEST(SearchMetadataSimpleTest, FindAndHighlight_MoreMetaChars) { | 615 TEST(SearchMetadataSimpleTest, FindAndHighlight_MoreMetaChars) { |
616 std::string highlighted_text; | 616 std::string highlighted_text; |
617 EXPECT_TRUE(FindAndHighlight("a&b&c&d", "b&c", &highlighted_text)); | 617 EXPECT_TRUE(FindAndHighlight("a&b&c&d", "b&c", &highlighted_text)); |
618 EXPECT_EQ("a&<b>b&c</b>&d", highlighted_text); | 618 EXPECT_EQ("a&<b>b&c</b>&d", highlighted_text); |
619 } | 619 } |
620 | 620 |
621 } // namespace internal | 621 } // namespace internal |
622 } // namespace drive | 622 } // namespace drive |
OLD | NEW |