Commit 5a773db5 authored by Jiaquan He's avatar Jiaquan He Committed by Commit Bot

app_list: move //ui/app_list/search/* into //chrome/browser/ui/app_list/search/

[1] Move tests
mkdir chrome/browser/ui/app_list/search/tests/
tools/git/move_source_file.py ui/app_list/search/*unittest.cc chrome/browser/ui/app_list/search/tests/
tools/git/move_source_file.py chrome/browser/ui/app_list/search/*unittest.cc chrome/browser/ui/app_list/search/tests/

[2] Move other files
tools/git/move_source_file.py ui/app_list/search_provider.* chrome/browser/ui/app_list/search/
tools/git/move_source_file.py ui/app_list/search/* chrome/browser/ui/app_list/search/

[3] Clean up, and move items from //ui/app_list/BUILD.gn into //chrome/browser/ui/BUILD.gn or //chrome/test/BUILD.gn
rmdir ui/app_list/search
grep -rl "#include \"ui/app_list/app_list_export.h\"" chrome/browser/ui/app_list/search/* | xargs sed -i "s/#include \"ui\/app_list\/app_list_export.h\"//g"
grep -rl "APP_LIST_EXPORT" chrome/browser/ui/app_list/search/* | xargs sed -i "s/APP_LIST_EXPORT//g"
git cl format

Bug: 733662
Change-Id: I493fcc9c16b8c75a0ba57f8258f6c6d11c5589ea
Reviewed-on: https://chromium-review.googlesource.com/955884Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Jiaquan He <hejq@google.com>
Cr-Commit-Position: refs/heads/master@{#541991}
parent 3345f3ff
...@@ -3498,10 +3498,20 @@ split_static_library("ui") { ...@@ -3498,10 +3498,20 @@ split_static_library("ui") {
"app_list/search/common/webservice_cache_factory.h", "app_list/search/common/webservice_cache_factory.h",
"app_list/search/common/webservice_search_provider.cc", "app_list/search/common/webservice_search_provider.cc",
"app_list/search/common/webservice_search_provider.h", "app_list/search/common/webservice_search_provider.h",
"app_list/search/dictionary_data_store.cc",
"app_list/search/dictionary_data_store.h",
"app_list/search/extension_app_result.cc", "app_list/search/extension_app_result.cc",
"app_list/search/extension_app_result.h", "app_list/search/extension_app_result.h",
"app_list/search/history.cc",
"app_list/search/history.h",
"app_list/search/history_data.cc",
"app_list/search/history_data.h",
"app_list/search/history_data_observer.h",
"app_list/search/history_data_store.cc",
"app_list/search/history_data_store.h",
"app_list/search/history_factory.cc", "app_list/search/history_factory.cc",
"app_list/search/history_factory.h", "app_list/search/history_factory.h",
"app_list/search/history_types.h",
"app_list/search/mixer.cc", "app_list/search/mixer.cc",
"app_list/search/mixer.h", "app_list/search/mixer.h",
"app_list/search/omnibox_provider.cc", "app_list/search/omnibox_provider.cc",
...@@ -3512,6 +3522,8 @@ split_static_library("ui") { ...@@ -3512,6 +3522,8 @@ split_static_library("ui") {
"app_list/search/search_controller.h", "app_list/search/search_controller.h",
"app_list/search/search_controller_factory.cc", "app_list/search/search_controller_factory.cc",
"app_list/search/search_controller_factory.h", "app_list/search/search_controller_factory.h",
"app_list/search/search_provider.cc",
"app_list/search/search_provider.h",
"app_list/search/search_resource_manager.cc", "app_list/search/search_resource_manager.cc",
"app_list/search/search_resource_manager.h", "app_list/search/search_resource_manager.h",
"app_list/search/search_util.cc", "app_list/search/search_util.cc",
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "base/time/time.h" #include "base/time/time.h"
#include "chrome/browser/ui/app_list/search/answer_card/answer_card_contents.h" #include "chrome/browser/ui/app_list/search/answer_card/answer_card_contents.h"
#include "ui/app_list/search_provider.h" #include "chrome/browser/ui/app_list/search/search_provider.h"
#include "url/gurl.h" #include "url/gurl.h"
class AppListControllerDelegate; class AppListControllerDelegate;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/scoped_observer.h" #include "base/scoped_observer.h"
#include "ui/app_list/search_provider.h" #include "chrome/browser/ui/app_list/search/search_provider.h"
class AppListControllerDelegate; class AppListControllerDelegate;
class AppListModelUpdater; class AppListModelUpdater;
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "chrome/browser/ui/app_list/search/search_provider.h"
#include "components/arc/common/app.mojom.h" #include "components/arc/common/app.mojom.h"
#include "ui/app_list/search_provider.h"
class Profile; class Profile;
class AppListControllerDelegate; class AppListControllerDelegate;
......
...@@ -6,14 +6,15 @@ ...@@ -6,14 +6,15 @@
#define CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_WEBSERVICE_CACHE_H_ #define CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_WEBSERVICE_CACHE_H_
#include <memory> #include <memory>
#include <string>
#include <utility> #include <utility>
#include "base/containers/mru_cache.h" #include "base/containers/mru_cache.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "chrome/browser/ui/app_list/search/dictionary_data_store.h"
#include "components/keyed_service/core/keyed_service.h" #include "components/keyed_service/core/keyed_service.h"
#include "ui/app_list/search/dictionary_data_store.h"
namespace base { namespace base {
class DictionaryValue; class DictionaryValue;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "base/time/time.h" #include "base/time/time.h"
#include "base/timer/timer.h" #include "base/timer/timer.h"
#include "chrome/browser/ui/app_list/search/common/webservice_cache.h" #include "chrome/browser/ui/app_list/search/common/webservice_cache.h"
#include "ui/app_list/search_provider.h" #include "chrome/browser/ui/app_list/search/search_provider.h"
class Profile; class Profile;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "ui/app_list/search/dictionary_data_store.h" #include "chrome/browser/ui/app_list/search/dictionary_data_store.h"
#include <set> #include <set>
#include <utility> #include <utility>
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef UI_APP_LIST_SEARCH_DICTIONARY_DATA_STORE_H_ #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_DICTIONARY_DATA_STORE_H_
#define UI_APP_LIST_SEARCH_DICTIONARY_DATA_STORE_H_ #define CHROME_BROWSER_UI_APP_LIST_SEARCH_DICTIONARY_DATA_STORE_H_
#include <memory> #include <memory>
#include <string> #include <string>
...@@ -14,19 +14,18 @@ ...@@ -14,19 +14,18 @@
#include "base/files/important_file_writer.h" #include "base/files/important_file_writer.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "ui/app_list/app_list_export.h"
namespace base { namespace base {
class DictionaryValue; class DictionaryValue;
class SequencedTaskRunner; class SequencedTaskRunner;
} } // namespace base
namespace app_list { namespace app_list {
// A simple JSON store to persist a dictionary. There must only be one // A simple JSON store to persist a dictionary. There must only be one
// DictionaryDataStore instance per data file at a time (writes issued by // DictionaryDataStore instance per data file at a time (writes issued by
// DictionaryDataStore instances bound to the same file would be racy). // DictionaryDataStore instances bound to the same file would be racy).
class APP_LIST_EXPORT DictionaryDataStore class DictionaryDataStore
: public base::RefCountedThreadSafe<DictionaryDataStore>, : public base::RefCountedThreadSafe<DictionaryDataStore>,
public base::ImportantFileWriter::DataSerializer { public base::ImportantFileWriter::DataSerializer {
public: public:
...@@ -74,4 +73,4 @@ class APP_LIST_EXPORT DictionaryDataStore ...@@ -74,4 +73,4 @@ class APP_LIST_EXPORT DictionaryDataStore
} // namespace app_list } // namespace app_list
#endif // UI_APP_LIST_SEARCH_DICTIONARY_DATA_STORE_H_ #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_DICTIONARY_DATA_STORE_H_
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "ui/app_list/search/history.h" #include "chrome/browser/ui/app_list/search/history.h"
#include <stddef.h> #include <stddef.h>
#include "ash/public/cpp/app_list/tokenized_string.h" #include "ash/public/cpp/app_list/tokenized_string.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "ui/app_list/search/history_data.h" #include "chrome/browser/ui/app_list/search/history_data.h"
#include "ui/app_list/search/history_data_store.h" #include "chrome/browser/ui/app_list/search/history_data_store.h"
namespace app_list { namespace app_list {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef UI_APP_LIST_SEARCH_HISTORY_H_ #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_H_
#define UI_APP_LIST_SEARCH_HISTORY_H_ #define CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_H_
#include <map> #include <map>
#include <memory> #include <memory>
...@@ -11,10 +11,9 @@ ...@@ -11,10 +11,9 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "chrome/browser/ui/app_list/search/history_data_observer.h"
#include "chrome/browser/ui/app_list/search/history_types.h"
#include "components/keyed_service/core/keyed_service.h" #include "components/keyed_service/core/keyed_service.h"
#include "ui/app_list/app_list_export.h"
#include "ui/app_list/search/history_data_observer.h"
#include "ui/app_list/search/history_types.h"
namespace app_list { namespace app_list {
...@@ -31,8 +30,7 @@ class SearchHistoryTest; ...@@ -31,8 +30,7 @@ class SearchHistoryTest;
// primary and secondary associations. See HistoryData comments to see how // primary and secondary associations. See HistoryData comments to see how
// they are built. The learning data is sent to the mixer to boost results that // they are built. The learning data is sent to the mixer to boost results that
// have been launched before. // have been launched before.
class APP_LIST_EXPORT History : public KeyedService, class History : public KeyedService, public HistoryDataObserver {
public HistoryDataObserver {
public: public:
explicit History(scoped_refptr<HistoryDataStore> store); explicit History(scoped_refptr<HistoryDataStore> store);
~History() override; ~History() override;
...@@ -62,4 +60,4 @@ class APP_LIST_EXPORT History : public KeyedService, ...@@ -62,4 +60,4 @@ class APP_LIST_EXPORT History : public KeyedService,
} // namespace app_list } // namespace app_list
#endif // UI_APP_LIST_SEARCH_HISTORY_H_ #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_H_
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "ui/app_list/search/history_data.h" #include "chrome/browser/ui/app_list/search/history_data.h"
#include <algorithm> #include <algorithm>
#include <vector> #include <vector>
#include "base/bind.h" #include "base/bind.h"
#include "ui/app_list/search/history_data_observer.h" #include "chrome/browser/ui/app_list/search/history_data_observer.h"
#include "ui/app_list/search/history_data_store.h" #include "chrome/browser/ui/app_list/search/history_data_store.h"
namespace app_list { namespace app_list {
...@@ -32,11 +32,9 @@ bool EntrySortByTimeAscending(const EntrySortData& entry1, ...@@ -32,11 +32,9 @@ bool EntrySortByTimeAscending(const EntrySortData& entry1,
} // namespace } // namespace
HistoryData::Data::Data() { HistoryData::Data::Data() {}
}
HistoryData::Data::Data(const Data& other) = default; HistoryData::Data::Data(const Data& other) = default;
HistoryData::Data::~Data() { HistoryData::Data::~Data() {}
}
HistoryData::HistoryData(HistoryDataStore* store, HistoryData::HistoryData(HistoryDataStore* store,
size_t max_primary, size_t max_primary,
...@@ -45,8 +43,7 @@ HistoryData::HistoryData(HistoryDataStore* store, ...@@ -45,8 +43,7 @@ HistoryData::HistoryData(HistoryDataStore* store,
store_->Load(base::Bind(&HistoryData::OnStoreLoaded, AsWeakPtr())); store_->Load(base::Bind(&HistoryData::OnStoreLoaded, AsWeakPtr()));
} }
HistoryData::~HistoryData() { HistoryData::~HistoryData() {}
}
void HistoryData::Add(const std::string& query, const std::string& result_id) { void HistoryData::Add(const std::string& query, const std::string& result_id) {
Associations::iterator assoc_it = associations_.find(query); Associations::iterator assoc_it = associations_.find(query);
...@@ -101,8 +98,7 @@ std::unique_ptr<KnownResults> HistoryData::GetKnownResults( ...@@ -101,8 +98,7 @@ std::unique_ptr<KnownResults> HistoryData::GetKnownResults(
const std::string& query) const { const std::string& query) const {
std::unique_ptr<KnownResults> results(new KnownResults); std::unique_ptr<KnownResults> results(new KnownResults);
for (Associations::const_iterator assoc_it = associations_.lower_bound(query); for (Associations::const_iterator assoc_it = associations_.lower_bound(query);
assoc_it != associations_.end(); assoc_it != associations_.end(); ++assoc_it) {
++assoc_it) {
// Break out of the loop if |query| is no longer a prefix. // Break out of the loop if |query| is no longer a prefix.
if (assoc_it->first.size() < query.size() || if (assoc_it->first.size() < query.size() ||
strncmp(assoc_it->first.c_str(), query.c_str(), query.length()) != 0) { strncmp(assoc_it->first.c_str(), query.c_str(), query.length()) != 0) {
...@@ -119,8 +115,7 @@ std::unique_ptr<KnownResults> HistoryData::GetKnownResults( ...@@ -119,8 +115,7 @@ std::unique_ptr<KnownResults> HistoryData::GetKnownResults(
const HistoryData::SecondaryDeque& secondary = assoc_it->second.secondary; const HistoryData::SecondaryDeque& secondary = assoc_it->second.secondary;
for (HistoryData::SecondaryDeque::const_iterator secondary_it = for (HistoryData::SecondaryDeque::const_iterator secondary_it =
secondary.begin(); secondary.begin();
secondary_it != secondary.end(); secondary_it != secondary.end(); ++secondary_it) {
++secondary_it) {
const std::string& secondary_result_id = (*secondary_it); const std::string& secondary_result_id = (*secondary_it);
// Secondary match only gets added if there there is no primary match. // Secondary match only gets added if there there is no primary match.
...@@ -155,16 +150,13 @@ void HistoryData::TrimEntries() { ...@@ -155,16 +150,13 @@ void HistoryData::TrimEntries() {
std::vector<EntrySortData> entries; std::vector<EntrySortData> entries;
for (Associations::const_iterator it = associations_.begin(); for (Associations::const_iterator it = associations_.begin();
it != associations_.end(); it != associations_.end(); ++it) {
++it) {
entries.push_back(EntrySortData(&it->first, &it->second.update_time)); entries.push_back(EntrySortData(&it->first, &it->second.update_time));
} }
const size_t entries_to_remove = associations_.size() - max_primary_; const size_t entries_to_remove = associations_.size() - max_primary_;
std::partial_sort(entries.begin(), std::partial_sort(entries.begin(), entries.begin() + entries_to_remove,
entries.begin() + entries_to_remove, entries.end(), &EntrySortByTimeAscending);
entries.end(),
&EntrySortByTimeAscending);
for (size_t i = 0; i < entries_to_remove; ++i) { for (size_t i = 0; i < entries_to_remove; ++i) {
const std::string& query = *entries[i].query; const std::string& query = *entries[i].query;
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef UI_APP_LIST_SEARCH_HISTORY_DATA_H_ #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_DATA_H_
#define UI_APP_LIST_SEARCH_HISTORY_DATA_H_ #define CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_DATA_H_
#include <stddef.h> #include <stddef.h>
...@@ -16,8 +16,7 @@ ...@@ -16,8 +16,7 @@
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/observer_list.h" #include "base/observer_list.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "ui/app_list/app_list_export.h" #include "chrome/browser/ui/app_list/search/history_types.h"
#include "ui/app_list/search/history_types.h"
namespace app_list { namespace app_list {
...@@ -33,12 +32,12 @@ class HistoryDataStore; ...@@ -33,12 +32,12 @@ class HistoryDataStore;
// secondary. However, if a secondary association is added twice in a row, it // secondary. However, if a secondary association is added twice in a row, it
// is promoted to primary and the current primary mapping is demoted into // is promoted to primary and the current primary mapping is demoted into
// secondary. // secondary.
class APP_LIST_EXPORT HistoryData : public base::SupportsWeakPtr<HistoryData> { class HistoryData : public base::SupportsWeakPtr<HistoryData> {
public: public:
using SecondaryDeque = base::circular_deque<std::string>; using SecondaryDeque = base::circular_deque<std::string>;
// Defines data to be associated with a query. // Defines data to be associated with a query.
struct APP_LIST_EXPORT Data { struct Data {
Data(); Data();
Data(const Data& other); Data(const Data& other);
~Data(); ~Data();
...@@ -94,4 +93,4 @@ class APP_LIST_EXPORT HistoryData : public base::SupportsWeakPtr<HistoryData> { ...@@ -94,4 +93,4 @@ class APP_LIST_EXPORT HistoryData : public base::SupportsWeakPtr<HistoryData> {
} // namespace app_list } // namespace app_list
#endif // UI_APP_LIST_SEARCH_HISTORY_DATA_H_ #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_DATA_H_
...@@ -2,14 +2,12 @@ ...@@ -2,14 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef UI_APP_LIST_SEARCH_HISTORY_DATA_OBSERVER_H_ #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_DATA_OBSERVER_H_
#define UI_APP_LIST_SEARCH_HISTORY_DATA_OBSERVER_H_ #define CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_DATA_OBSERVER_H_
#include "ui/app_list/app_list_export.h"
namespace app_list { namespace app_list {
class APP_LIST_EXPORT HistoryDataObserver { class HistoryDataObserver {
public: public:
// Invoked when the data is loaded from underlying store. // Invoked when the data is loaded from underlying store.
virtual void OnHistoryDataLoadedFromStore() = 0; virtual void OnHistoryDataLoadedFromStore() = 0;
...@@ -20,4 +18,4 @@ class APP_LIST_EXPORT HistoryDataObserver { ...@@ -20,4 +18,4 @@ class APP_LIST_EXPORT HistoryDataObserver {
} // namespace app_list } // namespace app_list
#endif // UI_APP_LIST_SEARCH_HISTORY_DATA_OBSERVER_H_ #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_DATA_OBSERVER_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "ui/app_list/search/history_data_store.h" #include "chrome/browser/ui/app_list/search/history_data_store.h"
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
...@@ -123,8 +123,7 @@ HistoryDataStore::HistoryDataStore( ...@@ -123,8 +123,7 @@ HistoryDataStore::HistoryDataStore(
Init(data_store_->cached_dict()); Init(data_store_->cached_dict());
} }
HistoryDataStore::~HistoryDataStore() { HistoryDataStore::~HistoryDataStore() {}
}
void HistoryDataStore::Init(base::DictionaryValue* cached_dict) { void HistoryDataStore::Init(base::DictionaryValue* cached_dict) {
DCHECK(cached_dict); DCHECK(cached_dict);
...@@ -143,8 +142,8 @@ void HistoryDataStore::Flush( ...@@ -143,8 +142,8 @@ void HistoryDataStore::Flush(
void HistoryDataStore::Load( void HistoryDataStore::Load(
const HistoryDataStore::OnLoadedCallback& on_loaded) { const HistoryDataStore::OnLoadedCallback& on_loaded) {
if (data_store_.get()) { if (data_store_.get()) {
data_store_->Load(base::Bind( data_store_->Load(base::Bind(&HistoryDataStore::OnDictionaryLoadedCallback,
&HistoryDataStore::OnDictionaryLoadedCallback, this, on_loaded)); this, on_loaded));
} else { } else {
OnDictionaryLoadedCallback(on_loaded, cached_dict_->CreateDeepCopy()); OnDictionaryLoadedCallback(on_loaded, cached_dict_->CreateDeepCopy());
} }
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef UI_APP_LIST_SEARCH_HISTORY_DATA_STORE_H_ #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_DATA_STORE_H_
#define UI_APP_LIST_SEARCH_HISTORY_DATA_STORE_H_ #define CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_DATA_STORE_H_
#include <memory> #include <memory>
#include <string> #include <string>
...@@ -12,9 +12,8 @@ ...@@ -12,9 +12,8 @@
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "ui/app_list/app_list_export.h" #include "chrome/browser/ui/app_list/search/dictionary_data_store.h"
#include "ui/app_list/search/dictionary_data_store.h" #include "chrome/browser/ui/app_list/search/history_data.h"
#include "ui/app_list/search/history_data.h"
namespace base { namespace base {
class Value; class Value;
...@@ -27,8 +26,7 @@ class HistoryDataStoreTest; ...@@ -27,8 +26,7 @@ class HistoryDataStoreTest;
} }
// A simple json store to persist HistoryData. // A simple json store to persist HistoryData.
class APP_LIST_EXPORT HistoryDataStore class HistoryDataStore : public base::RefCountedThreadSafe<HistoryDataStore> {
: public base::RefCountedThreadSafe<HistoryDataStore> {
public: public:
typedef base::Callback<void(std::unique_ptr<HistoryData::Associations>)> typedef base::Callback<void(std::unique_ptr<HistoryData::Associations>)>
OnLoadedCallback; OnLoadedCallback;
...@@ -83,4 +81,4 @@ class APP_LIST_EXPORT HistoryDataStore ...@@ -83,4 +81,4 @@ class APP_LIST_EXPORT HistoryDataStore
} // namespace app_list } // namespace app_list
#endif // UI_APP_LIST_SEARCH_HISTORY_DATA_STORE_H_ #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_DATA_STORE_H_
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/singleton.h" #include "base/memory/singleton.h"
#include "chrome/browser/ui/app_list/search/dictionary_data_store.h"
#include "chrome/browser/ui/app_list/search/history.h"
#include "chrome/browser/ui/app_list/search/history_data_store.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_context.h"
#include "ui/app_list/search/dictionary_data_store.h"
#include "ui/app_list/search/history.h"
#include "ui/app_list/search/history_data_store.h"
namespace app_list { namespace app_list {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef UI_APP_LIST_SEARCH_HISTORY_TYPES_H_ #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_TYPES_H_
#define UI_APP_LIST_SEARCH_HISTORY_TYPES_H_ #define CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_TYPES_H_
#include <map> #include <map>
#include <string> #include <string>
...@@ -24,4 +24,4 @@ typedef std::map<std::string, KnownResultType> KnownResults; ...@@ -24,4 +24,4 @@ typedef std::map<std::string, KnownResultType> KnownResults;
} // namespace app_list } // namespace app_list
#endif // UI_APP_LIST_SEARCH_HISTORY_TYPES_H_ #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_TYPES_H_
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
#include "base/timer/timer.h" #include "base/timer/timer.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/app_list/search/launcher_search/launcher_search_result.h" #include "chrome/browser/ui/app_list/search/launcher_search/launcher_search_result.h"
#include "chrome/browser/ui/app_list/search/search_provider.h"
#include "extensions/common/extension_id.h" #include "extensions/common/extension_id.h"
#include "ui/app_list/search_provider.h"
namespace app_list { namespace app_list {
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "chrome/browser/ui/app_list/app_list_model_updater.h" #include "chrome/browser/ui/app_list/app_list_model_updater.h"
#include "chrome/browser/ui/app_list/search/search_provider.h"
#include "ui/app_list/app_list_features.h" #include "ui/app_list/app_list_features.h"
#include "ui/app_list/search_provider.h"
namespace app_list { namespace app_list {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "base/gtest_prod_util.h" #include "base/gtest_prod_util.h"
#include "base/macros.h" #include "base/macros.h"
#include "ui/app_list/search/history_types.h" #include "chrome/browser/ui/app_list/search/history_types.h"
class AppListModelUpdater; class AppListModelUpdater;
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
#include <memory> #include <memory>
#include "base/macros.h" #include "base/macros.h"
#include "chrome/browser/ui/app_list/search/search_provider.h"
#include "components/omnibox/browser/autocomplete_controller_delegate.h" #include "components/omnibox/browser/autocomplete_controller_delegate.h"
#include "ui/app_list/search_provider.h"
class AppListControllerDelegate; class AppListControllerDelegate;
class AutocompleteController; class AutocompleteController;
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/app_list/app_list_model_updater.h" #include "chrome/browser/ui/app_list/app_list_model_updater.h"
#include "chrome/browser/ui/app_list/search/history.h"
#include "chrome/browser/ui/app_list/search/search_provider.h"
#include "ui/app_list/app_list_constants.h" #include "ui/app_list/app_list_constants.h"
#include "ui/app_list/search/history.h"
#include "ui/app_list/search_provider.h"
namespace app_list { namespace app_list {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "ui/app_list/search_provider.h" #include "chrome/browser/ui/app_list/search/search_provider.h"
#include <utility> #include <utility>
...@@ -10,10 +10,8 @@ ...@@ -10,10 +10,8 @@
namespace app_list { namespace app_list {
SearchProvider::SearchProvider() { SearchProvider::SearchProvider() {}
} SearchProvider::~SearchProvider() {}
SearchProvider::~SearchProvider() {
}
void SearchProvider::Add(std::unique_ptr<SearchResult> result) { void SearchProvider::Add(std::unique_ptr<SearchResult> result) {
results_.emplace_back(std::move(result)); results_.emplace_back(std::move(result));
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef UI_APP_LIST_SEARCH_PROVIDER_H_ #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_SEARCH_PROVIDER_H_
#define UI_APP_LIST_SEARCH_PROVIDER_H_ #define CHROME_BROWSER_UI_APP_LIST_SEARCH_SEARCH_PROVIDER_H_
#include <memory> #include <memory>
#include <vector> #include <vector>
...@@ -11,13 +11,12 @@ ...@@ -11,13 +11,12 @@
#include "base/callback.h" #include "base/callback.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "ui/app_list/app_list_export.h"
namespace app_list { namespace app_list {
class SearchResult; class SearchResult;
class APP_LIST_EXPORT SearchProvider { class SearchProvider {
public: public:
using Results = std::vector<std::unique_ptr<SearchResult>>; using Results = std::vector<std::unique_ptr<SearchResult>>;
using ResultChangedCallback = base::Closure; using ResultChangedCallback = base::Closure;
...@@ -56,4 +55,4 @@ class APP_LIST_EXPORT SearchProvider { ...@@ -56,4 +55,4 @@ class APP_LIST_EXPORT SearchProvider {
} // namespace app_list } // namespace app_list
#endif // UI_APP_LIST_SEARCH_PROVIDER_H_ #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_SEARCH_PROVIDER_H_
...@@ -200,8 +200,7 @@ TEST_F(AppSearchProviderTest, UninstallExtension) { ...@@ -200,8 +200,7 @@ TEST_F(AppSearchProviderTest, UninstallExtension) {
EXPECT_EQ("Packaged App 1", RunQuery("pa1")); EXPECT_EQ("Packaged App 1", RunQuery("pa1"));
EXPECT_FALSE(results().empty()); EXPECT_FALSE(results().empty());
service_->UninstallExtension(kPackagedApp1Id, service_->UninstallExtension(kPackagedApp1Id,
extensions::UNINSTALL_REASON_FOR_TESTING, extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
NULL);
// Allow async AppSearchProvider::UpdateResults to run. // Allow async AppSearchProvider::UpdateResults to run.
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "ui/app_list/search/history_data_store.h" #include "chrome/browser/ui/app_list/search/history_data_store.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/test/scoped_task_environment.h" #include "base/test/scoped_task_environment.h"
#include "chrome/browser/ui/app_list/search/dictionary_data_store.h"
#include "chrome/browser/ui/app_list/search/history_data.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "ui/app_list/search/dictionary_data_store.h"
#include "ui/app_list/search/history_data.h"
namespace app_list { namespace app_list {
namespace test { namespace test {
...@@ -24,8 +24,7 @@ std::string GetDataContent(const HistoryData::Data& data) { ...@@ -24,8 +24,7 @@ std::string GetDataContent(const HistoryData::Data& data) {
std::string str = std::string("p:") + data.primary + ";s:"; std::string str = std::string("p:") + data.primary + ";s:";
bool first = true; bool first = true;
for (HistoryData::SecondaryDeque::const_iterator it = data.secondary.begin(); for (HistoryData::SecondaryDeque::const_iterator it = data.secondary.begin();
it != data.secondary.end(); it != data.secondary.end(); ++it) {
++it) {
if (first) if (first)
first = false; first = false;
else else
...@@ -46,9 +45,7 @@ class HistoryDataStoreTest : public testing::Test { ...@@ -46,9 +45,7 @@ class HistoryDataStoreTest : public testing::Test {
base::test::ScopedTaskEnvironment::MainThreadType::UI) {} base::test::ScopedTaskEnvironment::MainThreadType::UI) {}
// testing::Test overrides: // testing::Test overrides:
void SetUp() override { void SetUp() override { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); }
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
}
void TearDown() override { void TearDown() override {
// Release |store_| while ui loop is still running. // Release |store_| while ui loop is still running.
store_ = NULL; store_ = NULL;
......
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/test/scoped_task_environment.h" #include "base/test/scoped_task_environment.h"
#include "base/threading/platform_thread.h" #include "base/threading/platform_thread.h"
#include "chrome/browser/ui/app_list/search/dictionary_data_store.h"
#include "chrome/browser/ui/app_list/search/history.h"
#include "chrome/browser/ui/app_list/search/history_data.h"
#include "chrome/browser/ui/app_list/search/history_data_observer.h"
#include "chrome/browser/ui/app_list/search/history_data_store.h"
#include "chrome/browser/ui/app_list/search/history_factory.h" #include "chrome/browser/ui/app_list/search/history_factory.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "ui/app_list/search/dictionary_data_store.h"
#include "ui/app_list/search/history.h"
#include "ui/app_list/search/history_data.h"
#include "ui/app_list/search/history_data_observer.h"
#include "ui/app_list/search/history_data_store.h"
namespace app_list { namespace app_list {
namespace test { namespace test {
...@@ -35,7 +35,7 @@ const size_t kMaxSecondary = 2; ...@@ -35,7 +35,7 @@ const size_t kMaxSecondary = 2;
// has passed. // has passed.
class HistoryDataLoadWaiter : public HistoryDataObserver { class HistoryDataLoadWaiter : public HistoryDataObserver {
public: public:
explicit HistoryDataLoadWaiter(HistoryData* data) : data_(data) {} explicit HistoryDataLoadWaiter(HistoryData* data) : data_(data) {}
~HistoryDataLoadWaiter() override {} ~HistoryDataLoadWaiter() override {}
void Wait() { void Wait() {
...@@ -75,9 +75,7 @@ class StoreFlushWaiter { ...@@ -75,9 +75,7 @@ class StoreFlushWaiter {
} }
private: private:
void OnFlushed() { void OnFlushed() { run_loop_->Quit(); }
run_loop_->Quit();
}
HistoryDataStore* store_; // Not owned. HistoryDataStore* store_; // Not owned.
std::unique_ptr<base::RunLoop> run_loop_; std::unique_ptr<base::RunLoop> run_loop_;
...@@ -99,9 +97,7 @@ class SearchHistoryTest : public testing::Test { ...@@ -99,9 +97,7 @@ class SearchHistoryTest : public testing::Test {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
CreateHistory(); CreateHistory();
} }
void TearDown() override { void TearDown() override { Flush(); }
Flush();
}
void CreateHistory() { void CreateHistory() {
const char kStoreDataFileName[] = "app-launcher-test"; const char kStoreDataFileName[] = "app-launcher-test";
...@@ -121,9 +117,7 @@ class SearchHistoryTest : public testing::Test { ...@@ -121,9 +117,7 @@ class SearchHistoryTest : public testing::Test {
ASSERT_TRUE(history_->IsReady()); ASSERT_TRUE(history_->IsReady());
} }
void Flush() { void Flush() { StoreFlushWaiter(history_->store_.get()).Wait(); }
StoreFlushWaiter(history_->store_.get()).Wait();
}
size_t GetKnownResults(const std::string& query) { size_t GetKnownResults(const std::string& query) {
known_results_ = history()->GetKnownResults(query); known_results_ = history()->GetKnownResults(query);
......
...@@ -16,12 +16,12 @@ ...@@ -16,12 +16,12 @@
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/app_list/search/history_types.h"
#include "chrome/browser/ui/app_list/search/search_provider.h"
#include "chrome/browser/ui/app_list/test/fake_app_list_model_updater.h" #include "chrome/browser/ui/app_list/test/fake_app_list_model_updater.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "ui/app_list/app_list_constants.h" #include "ui/app_list/app_list_constants.h"
#include "ui/app_list/app_list_features.h" #include "ui/app_list/app_list_features.h"
#include "ui/app_list/search/history_types.h"
#include "ui/app_list/search_provider.h"
class FakeAppListModelUpdater; class FakeAppListModelUpdater;
......
...@@ -22,11 +22,9 @@ namespace { ...@@ -22,11 +22,9 @@ namespace {
// the current char in terms of the original text of the TokenizedString. The // the current char in terms of the original text of the TokenizedString. The
// last one is optional and only shows up when IsFirstCharOfToken returns true. // last one is optional and only shows up when IsFirstCharOfToken returns true.
std::string GetIterateState(const TokenizedStringCharIterator& iter) { std::string GetIterateState(const TokenizedStringCharIterator& iter) {
return base::StringPrintf("%s%d%s", return base::StringPrintf(
base::UTF16ToUTF8( "%s%d%s", base::UTF16ToUTF8(base::string16(1, iter.Get())).c_str(),
base::string16(1, iter.Get())).c_str(), iter.GetArrayPos(), iter.IsFirstCharOfToken() ? "!" : "");
iter.GetArrayPos(),
iter.IsFirstCharOfToken() ? "!" : "");
} }
void TestBeyondTheEnd(TokenizedStringCharIterator* iter) { void TestBeyondTheEnd(TokenizedStringCharIterator* iter) {
......
...@@ -37,20 +37,16 @@ TEST(TokenizedStringMatchTest, NotMatch) { ...@@ -37,20 +37,16 @@ TEST(TokenizedStringMatchTest, NotMatch) {
const char* text; const char* text;
const char* query; const char* query;
} kTestCases[] = { } kTestCases[] = {
{ "", "" }, {"", ""}, {"", "query"},
{ "", "query" }, {"text", ""}, {"!", "!@#$%^&*()<<<**>>>"},
{ "text", "" }, {"abd", "abcd"}, {"cd", "abcd"},
{ "!", "!@#$%^&*()<<<**>>>" },
{ "abd", "abcd"},
{ "cd", "abcd"},
}; };
TokenizedStringMatch match; TokenizedStringMatch match;
for (size_t i = 0; i < arraysize(kTestCases); ++i) { for (size_t i = 0; i < arraysize(kTestCases); ++i) {
const base::string16 text(base::UTF8ToUTF16(kTestCases[i].text)); const base::string16 text(base::UTF8ToUTF16(kTestCases[i].text));
EXPECT_FALSE(match.Calculate(base::UTF8ToUTF16(kTestCases[i].query), text)) EXPECT_FALSE(match.Calculate(base::UTF8ToUTF16(kTestCases[i].query), text))
<< "Test case " << i << "Test case " << i << " : text=" << kTestCases[i].text
<< " : text=" << kTestCases[i].text
<< ", query=" << kTestCases[i].query; << ", query=" << kTestCases[i].query;
} }
} }
...@@ -61,17 +57,17 @@ TEST(TokenizedStringMatchTest, Match) { ...@@ -61,17 +57,17 @@ TEST(TokenizedStringMatchTest, Match) {
const char* query; const char* query;
const char* expect; const char* expect;
} kTestCases[] = { } kTestCases[] = {
{ "ScratchPad", "pad", "Scratch[Pad]" }, {"ScratchPad", "pad", "Scratch[Pad]"},
{ "ScratchPad", "sp", "[S]cratch[P]ad" }, {"ScratchPad", "sp", "[S]cratch[P]ad"},
{ "Chess2", "che", "[Che]ss2" }, {"Chess2", "che", "[Che]ss2"},
{ "Chess2", "c2", "[C]hess[2]" }, {"Chess2", "c2", "[C]hess[2]"},
{ "Cut the rope", "cut ro", "[Cut] the [ro]pe" }, {"Cut the rope", "cut ro", "[Cut] the [ro]pe"},
{ "Cut the rope", "cr", "[C]ut the [r]ope" }, {"Cut the rope", "cr", "[C]ut the [r]ope"},
{ "John Doe", "jdoe", "[J]ohn [Doe]" }, {"John Doe", "jdoe", "[J]ohn [Doe]"},
{ "John Doe", "johnd", "[John D]oe" }, {"John Doe", "johnd", "[John D]oe"},
{ "Secure Shell", "she", "Secure [She]ll" }, {"Secure Shell", "she", "Secure [She]ll"},
{ "Simple Secure Shell", "sish", "[Si]mple Secure [Sh]ell" }, {"Simple Secure Shell", "sish", "[Si]mple Secure [Sh]ell"},
{ "Netflix", "flix", "Net[flix]" }, {"Netflix", "flix", "Net[flix]"},
}; };
TokenizedStringMatch match; TokenizedStringMatch match;
...@@ -88,21 +84,21 @@ TEST(TokenizedStringMatchTest, Relevance) { ...@@ -88,21 +84,21 @@ TEST(TokenizedStringMatchTest, Relevance) {
const char* query_low; const char* query_low;
const char* query_high; const char* query_high;
} kTestCases[] = { } kTestCases[] = {
// More matched chars are better. // More matched chars are better.
{ "Google Chrome", "g", "go" }, {"Google Chrome", "g", "go"},
{ "Google Chrome", "go", "goo" }, {"Google Chrome", "go", "goo"},
{ "Google Chrome", "goo", "goog" }, {"Google Chrome", "goo", "goog"},
{ "Google Chrome", "c", "ch" }, {"Google Chrome", "c", "ch"},
{ "Google Chrome", "ch", "chr" }, {"Google Chrome", "ch", "chr"},
// Acronym match is better than something in the middle. // Acronym match is better than something in the middle.
{ "Google Chrome", "ch", "gc" }, {"Google Chrome", "ch", "gc"},
// Prefix match is better than middle match and acronym match. // Prefix match is better than middle match and acronym match.
{ "Google Chrome", "ch", "go" }, {"Google Chrome", "ch", "go"},
{ "Google Chrome", "gc", "go" }, {"Google Chrome", "gc", "go"},
// Substring match has the lowest score. // Substring match has the lowest score.
{ "Google Chrome", "oo", "gc" }, {"Google Chrome", "oo", "gc"},
{ "Google Chrome", "oo", "go" }, {"Google Chrome", "oo", "go"},
{ "Google Chrome", "oo", "ch" }, {"Google Chrome", "oo", "ch"},
}; };
TokenizedStringMatch match_low; TokenizedStringMatch match_low;
...@@ -114,8 +110,7 @@ TEST(TokenizedStringMatchTest, Relevance) { ...@@ -114,8 +110,7 @@ TEST(TokenizedStringMatchTest, Relevance) {
EXPECT_TRUE(match_high.Calculate( EXPECT_TRUE(match_high.Calculate(
base::UTF8ToUTF16(kTestCases[i].query_high), text)); base::UTF8ToUTF16(kTestCases[i].query_high), text));
EXPECT_LT(match_low.relevance(), match_high.relevance()) EXPECT_LT(match_low.relevance(), match_high.relevance())
<< "Test case " << i << "Test case " << i << " : text=" << kTestCases[i].text
<< " : text=" << kTestCases[i].text
<< ", query_low=" << kTestCases[i].query_low << ", query_low=" << kTestCases[i].query_low
<< ", query_high=" << kTestCases[i].query_high; << ", query_high=" << kTestCases[i].query_high;
} }
......
...@@ -40,14 +40,12 @@ TEST(TokenizedStringTest, Basic) { ...@@ -40,14 +40,12 @@ TEST(TokenizedStringTest, Basic) {
{ {
base::string16 text(base::UTF8ToUTF16("ScratchPad")); base::string16 text(base::UTF8ToUTF16("ScratchPad"));
TokenizedString tokens(text); TokenizedString tokens(text);
EXPECT_EQ(base::UTF8ToUTF16("scratch{0,7} pad{7,10}"), EXPECT_EQ(base::UTF8ToUTF16("scratch{0,7} pad{7,10}"), GetContent(tokens));
GetContent(tokens));
} }
{ {
base::string16 text(base::UTF8ToUTF16("Chess2.0")); base::string16 text(base::UTF8ToUTF16("Chess2.0"));
TokenizedString tokens(text); TokenizedString tokens(text);
EXPECT_EQ(base::UTF8ToUTF16("chess{0,5} 2.0{5,8}"), EXPECT_EQ(base::UTF8ToUTF16("chess{0,5} 2.0{5,8}"), GetContent(tokens));
GetContent(tokens));
} }
{ {
base::string16 text(base::UTF8ToUTF16("Cut the rope")); base::string16 text(base::UTF8ToUTF16("Cut the rope"));
...@@ -70,8 +68,7 @@ TEST(TokenizedStringTest, Basic) { ...@@ -70,8 +68,7 @@ TEST(TokenizedStringTest, Basic) {
{ {
base::string16 text(base::UTF8ToUTF16("Draw-It!")); base::string16 text(base::UTF8ToUTF16("Draw-It!"));
TokenizedString tokens(text); TokenizedString tokens(text);
EXPECT_EQ(base::UTF8ToUTF16("draw{0,4} it{5,7}"), EXPECT_EQ(base::UTF8ToUTF16("draw{0,4} it{5,7}"), GetContent(tokens));
GetContent(tokens));
} }
{ {
base::string16 text(base::UTF8ToUTF16("Faxing & Signing")); base::string16 text(base::UTF8ToUTF16("Faxing & Signing"));
...@@ -82,8 +79,7 @@ TEST(TokenizedStringTest, Basic) { ...@@ -82,8 +79,7 @@ TEST(TokenizedStringTest, Basic) {
{ {
base::string16 text(base::UTF8ToUTF16("!@#$%^&*()<<<**>>>")); base::string16 text(base::UTF8ToUTF16("!@#$%^&*()<<<**>>>"));
TokenizedString tokens(text); TokenizedString tokens(text);
EXPECT_EQ(base::UTF8ToUTF16(""), EXPECT_EQ(base::UTF8ToUTF16(""), GetContent(tokens));
GetContent(tokens));
} }
} }
......
...@@ -4304,12 +4304,17 @@ test("unit_tests") { ...@@ -4304,12 +4304,17 @@ test("unit_tests") {
"../browser/ui/app_list/profile_loader_unittest.cc", "../browser/ui/app_list/profile_loader_unittest.cc",
"../browser/ui/app_list/search/answer_card/answer_card_result_unittest.cc", "../browser/ui/app_list/search/answer_card/answer_card_result_unittest.cc",
"../browser/ui/app_list/search/answer_card/answer_card_search_provider_unittest.cc", "../browser/ui/app_list/search/answer_card/answer_card_search_provider_unittest.cc",
"../browser/ui/app_list/search/app_search_provider_unittest.cc",
"../browser/ui/app_list/search/arc/arc_playstore_search_provider_unittest.cc", "../browser/ui/app_list/search/arc/arc_playstore_search_provider_unittest.cc",
"../browser/ui/app_list/search/history_unittest.cc",
"../browser/ui/app_list/search/launcher_search/launcher_search_icon_image_loader_unittest.cc", "../browser/ui/app_list/search/launcher_search/launcher_search_icon_image_loader_unittest.cc",
"../browser/ui/app_list/search/mixer_unittest.cc", "../browser/ui/app_list/search/tests/app_search_provider_unittest.cc",
"../browser/ui/app_list/search/omnibox_result_unittest.cc", "../browser/ui/app_list/search/tests/history_data_store_unittest.cc",
"../browser/ui/app_list/search/tests/history_unittest.cc",
"../browser/ui/app_list/search/tests/mixer_unittest.cc",
"../browser/ui/app_list/search/tests/omnibox_result_unittest.cc",
"../browser/ui/app_list/search/tests/term_break_iterator_unittest.cc",
"../browser/ui/app_list/search/tests/tokenized_string_char_iterator_unittest.cc",
"../browser/ui/app_list/search/tests/tokenized_string_match_unittest.cc",
"../browser/ui/app_list/search/tests/tokenized_string_unittest.cc",
"../browser/ui/app_list/test/fake_app_list_model_updater.cc", "../browser/ui/app_list/test/fake_app_list_model_updater.cc",
"../browser/ui/app_list/test/fake_app_list_model_updater.h", "../browser/ui/app_list/test/fake_app_list_model_updater.h",
"../browser/ui/app_list/test/fake_profile.cc", "../browser/ui/app_list/test/fake_profile.cc",
......
...@@ -26,18 +26,6 @@ component("app_list") { ...@@ -26,18 +26,6 @@ component("app_list") {
"pagination_model.cc", "pagination_model.cc",
"pagination_model.h", "pagination_model.h",
"pagination_model_observer.h", "pagination_model_observer.h",
"search/dictionary_data_store.cc",
"search/dictionary_data_store.h",
"search/history.cc",
"search/history.h",
"search/history_data.cc",
"search/history_data.h",
"search/history_data_observer.h",
"search/history_data_store.cc",
"search/history_data_store.h",
"search/history_types.h",
"search_provider.cc",
"search_provider.h",
"views/app_list_drag_and_drop_host.h", "views/app_list_drag_and_drop_host.h",
"views/app_list_folder_view.cc", "views/app_list_folder_view.cc",
"views/app_list_folder_view.h", "views/app_list_folder_view.h",
...@@ -192,11 +180,6 @@ test("app_list_unittests") { ...@@ -192,11 +180,6 @@ test("app_list_unittests") {
sources = [ sources = [
"folder_image_unittest.cc", "folder_image_unittest.cc",
"pagination_model_unittest.cc", "pagination_model_unittest.cc",
"search/history_data_store_unittest.cc",
"search/term_break_iterator_unittest.cc",
"search/tokenized_string_char_iterator_unittest.cc",
"search/tokenized_string_match_unittest.cc",
"search/tokenized_string_unittest.cc",
"test/run_all_unittests.cc", "test/run_all_unittests.cc",
"views/app_list_main_view_unittest.cc", "views/app_list_main_view_unittest.cc",
"views/app_list_view_unittest.cc", "views/app_list_view_unittest.cc",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment