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

Side by Side Diff: chrome/browser/chromeos/drive/search_metadata_unittest.cc

Issue 17249004: drive: Use ResourceMetadataStorage from FileCache (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More precise old DB handling Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
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()));
72 ASSERT_TRUE(metadata_storage_->Initialize()); 72 ASSERT_TRUE(metadata_storage_->Initialize());
73 73
74 cache_.reset(new internal::FileCache(temp_dir_.path(), 74 cache_.reset(new FileCache(metadata_storage_.get(),
75 temp_dir_.path(), 75 temp_dir_.path(),
76 base::MessageLoopProxy::current(), 76 base::MessageLoopProxy::current(),
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 }
87 87
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 } 587 }
588 588
589 TEST(SearchMetadataSimpleTest, FindAndHighlight_MoreMetaChars) { 589 TEST(SearchMetadataSimpleTest, FindAndHighlight_MoreMetaChars) {
590 std::string highlighted_text; 590 std::string highlighted_text;
591 EXPECT_TRUE(FindAndHighlight("a&b&c&d", "b&c", &highlighted_text)); 591 EXPECT_TRUE(FindAndHighlight("a&b&c&d", "b&c", &highlighted_text));
592 EXPECT_EQ("a&amp;<b>b&amp;c</b>&amp;d", highlighted_text); 592 EXPECT_EQ("a&amp;<b>b&amp;c</b>&amp;d", highlighted_text);
593 } 593 }
594 594
595 } // namespace internal 595 } // namespace internal
596 } // namespace drive 596 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/resource_metadata_storage.cc ('k') | chrome/browser/chromeos/drive/sync_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698