| 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/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 } // namespace | 62 } // namespace |
| 63 | 63 |
| 64 class SearchMetadataTest : public testing::Test { | 64 class SearchMetadataTest : public testing::Test { |
| 65 protected: | 65 protected: |
| 66 virtual void SetUp() OVERRIDE { | 66 virtual void SetUp() OVERRIDE { |
| 67 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 67 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 68 fake_free_disk_space_getter_.reset(new FakeFreeDiskSpaceGetter); | 68 fake_free_disk_space_getter_.reset(new FakeFreeDiskSpaceGetter); |
| 69 | 69 |
| 70 metadata_storage_.reset(new ResourceMetadataStorage( | 70 metadata_storage_.reset(new ResourceMetadataStorage( |
| 71 temp_dir_.path(), base::MessageLoopProxy::current())); | 71 temp_dir_.path(), base::MessageLoopProxy::current().get())); |
| 72 ASSERT_TRUE(metadata_storage_->Initialize()); | 72 ASSERT_TRUE(metadata_storage_->Initialize()); |
| 73 | 73 |
| 74 cache_.reset(new FileCache(metadata_storage_.get(), | 74 cache_.reset(new FileCache(metadata_storage_.get(), |
| 75 temp_dir_.path(), | 75 temp_dir_.path(), |
| 76 base::MessageLoopProxy::current(), | 76 base::MessageLoopProxy::current().get(), |
| 77 fake_free_disk_space_getter_.get())); | 77 fake_free_disk_space_getter_.get())); |
| 78 ASSERT_TRUE(cache_->Initialize()); | 78 ASSERT_TRUE(cache_->Initialize()); |
| 79 | 79 |
| 80 resource_metadata_.reset( | 80 resource_metadata_.reset( |
| 81 new ResourceMetadata(metadata_storage_.get(), | 81 new ResourceMetadata(metadata_storage_.get(), |
| 82 base::MessageLoopProxy::current())); | 82 base::MessageLoopProxy::current())); |
| 83 ASSERT_EQ(FILE_ERROR_OK, resource_metadata_->Initialize()); | 83 ASSERT_EQ(FILE_ERROR_OK, resource_metadata_->Initialize()); |
| 84 | 84 |
| 85 AddEntriesToMetadata(); | 85 AddEntriesToMetadata(); |
| 86 } | 86 } |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 } | 565 } |
| 566 | 566 |
| 567 TEST(SearchMetadataSimpleTest, FindAndHighlight_MoreMetaChars) { | 567 TEST(SearchMetadataSimpleTest, FindAndHighlight_MoreMetaChars) { |
| 568 std::string highlighted_text; | 568 std::string highlighted_text; |
| 569 EXPECT_TRUE(FindAndHighlight("a&b&c&d", "b&c", &highlighted_text)); | 569 EXPECT_TRUE(FindAndHighlight("a&b&c&d", "b&c", &highlighted_text)); |
| 570 EXPECT_EQ("a&<b>b&c</b>&d", highlighted_text); | 570 EXPECT_EQ("a&<b>b&c</b>&d", highlighted_text); |
| 571 } | 571 } |
| 572 | 572 |
| 573 } // namespace internal | 573 } // namespace internal |
| 574 } // namespace drive | 574 } // namespace drive |
| OLD | NEW |