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/threading/sequenced_worker_pool.h" | 9 #include "base/threading/sequenced_worker_pool.h" |
10 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" | 10 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 FileError error = FILE_ERROR_FAILED; | 108 FileError error = FILE_ERROR_FAILED; |
109 base::FilePath drive_path; | 109 base::FilePath drive_path; |
110 | 110 |
111 resource_metadata_->AddEntry( | 111 resource_metadata_->AddEntry( |
112 entry, | 112 entry, |
113 google_apis::test_util::CreateCopyResultCallback(&error, &drive_path)); | 113 google_apis::test_util::CreateCopyResultCallback(&error, &drive_path)); |
114 google_apis::test_util::RunBlockingPoolTask(); | 114 google_apis::test_util::RunBlockingPoolTask(); |
115 EXPECT_EQ(FILE_ERROR_OK, error); | 115 EXPECT_EQ(FILE_ERROR_OK, error); |
116 } | 116 } |
117 | 117 |
118 MessageLoopForUI message_loop_; | 118 base::MessageLoopForUI message_loop_; |
119 content::TestBrowserThread ui_thread_; | 119 content::TestBrowserThread ui_thread_; |
120 base::ScopedTempDir temp_dir_; | 120 base::ScopedTempDir temp_dir_; |
121 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 121 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
122 scoped_ptr<DriveResourceMetadata, test_util::DestroyHelperForTests> | 122 scoped_ptr<DriveResourceMetadata, test_util::DestroyHelperForTests> |
123 resource_metadata_; | 123 resource_metadata_; |
124 }; | 124 }; |
125 | 125 |
126 TEST_F(SearchMetadataTest, SearchMetadata_ZeroMatches) { | 126 TEST_F(SearchMetadataTest, SearchMetadata_ZeroMatches) { |
127 FileError error = FILE_ERROR_FAILED; | 127 FileError error = FILE_ERROR_FAILED; |
128 scoped_ptr<MetadataSearchResultVector> result; | 128 scoped_ptr<MetadataSearchResultVector> result; |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 EXPECT_EQ("<<b>hello</b>>", highlighted_text); | 410 EXPECT_EQ("<<b>hello</b>>", highlighted_text); |
411 } | 411 } |
412 | 412 |
413 TEST(SearchMetadataSimpleTest, FindAndHighlight_MoreMetaChars) { | 413 TEST(SearchMetadataSimpleTest, FindAndHighlight_MoreMetaChars) { |
414 std::string highlighted_text; | 414 std::string highlighted_text; |
415 EXPECT_TRUE(FindAndHighlight("a&b&c&d", "b&c", &highlighted_text)); | 415 EXPECT_TRUE(FindAndHighlight("a&b&c&d", "b&c", &highlighted_text)); |
416 EXPECT_EQ("a&<b>b&c</b>&d", highlighted_text); | 416 EXPECT_EQ("a&<b>b&c</b>&d", highlighted_text); |
417 } | 417 } |
418 | 418 |
419 } // namespace drive | 419 } // namespace drive |
OLD | NEW |