#include "chrome/browser/history/history_notifications.h"
#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
-#include "chrome/browser/history/history_types.h"
#include "chrome/browser/invalidation/fake_invalidation_service.h"
#include "chrome/browser/invalidation/profile_invalidation_provider_factory.h"
#include "chrome/browser/prefs/pref_service_syncable.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/testing_profile_manager.h"
+#include "components/history/core/browser/history_types.h"
#include "components/invalidation/invalidation_service.h"
#include "components/invalidation/profile_invalidation_provider.h"
#include "components/keyed_service/content/refcounted_browser_context_keyed_service.h"
void set_task_runner(
scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
- DCHECK(task_runner);
+ DCHECK(task_runner.get());
task_runner_ = task_runner;
}
virtual ~HistoryServiceMock() {}
void RunTaskOnDBThread(history::HistoryDBTask* task) {
- EXPECT_TRUE(task->RunOnDBThread(backend_, NULL));
+ EXPECT_TRUE(task->RunOnDBThread(backend_.get(), NULL));
}
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
data_type_controller,
&error_handler_,
&model_associator));
- EXPECT_CALL(*components, CreateDataTypeManager(_, _, _, _, _, _)).
+ EXPECT_CALL(*components, CreateDataTypeManager(_, _, _, _, _)).
WillOnce(ReturnNewDataTypeManager());
ProfileOAuth2TokenService* oauth2_token_service =
history_url.set_hidden(hidden);
visits->push_back(history::VisitRow(
history_url.id(), history_url.last_visit(), 0,
- content::PAGE_TRANSITION_TYPED, 0));
+ ui::PAGE_TRANSITION_TYPED, 0));
history_url.set_visit_count(visits->size());
return history_url;
}
history::VisitVector visits;
visits.push_back(history::VisitRow(
entries[i].id(), entries[i].last_visit(), 0,
- content::PageTransitionFromInt(0), 0));
+ ui::PageTransitionFromInt(0), 0));
test->AddTypedUrlSyncNode(entries[i], visits);
}
}
history::VisitVector merged_visits;
merged_visits.push_back(history::VisitRow(
sync_entry.id(), base::Time::FromInternalValue(15), 0,
- content::PageTransitionFromInt(0), 0));
+ ui::PageTransitionFromInt(0), 0));
history::URLRow merged_entry(MakeTypedUrlEntry("http://native.com", "name",
2, 17, false, &merged_visits));
history::URLVisitedDetails details;
details.row = added_entry;
- details.transition = content::PAGE_TRANSITION_TYPED;
+ details.transition = ui::PAGE_TRANSITION_TYPED;
scoped_refptr<ThreadNotifier> notifier(
new ThreadNotifier(history_thread_.get()));
notifier->Notify(chrome::NOTIFICATION_HISTORY_URL_VISITED,
history::URLVisitedDetails details;
details.row = updated_entry;
- details.transition = content::PAGE_TRANSITION_TYPED;
+ details.transition = ui::PAGE_TRANSITION_TYPED;
scoped_refptr<ThreadNotifier> notifier(
new ThreadNotifier(history_thread_.get()));
notifier->Notify(chrome::NOTIFICATION_HISTORY_URL_VISITED,
details.row = updated_entry;
// Should ignore this change because it's not TYPED.
- details.transition = content::PAGE_TRANSITION_RELOAD;
+ details.transition = ui::PAGE_TRANSITION_RELOAD;
scoped_refptr<ThreadNotifier> notifier(
new ThreadNotifier(history_thread_.get()));
notifier->Notify(chrome::NOTIFICATION_HISTORY_URL_VISITED,
12, 15, false,
&updated_visits));
details.row = twelve_visits;
- details.transition = content::PAGE_TRANSITION_TYPED;
+ details.transition = ui::PAGE_TRANSITION_TYPED;
notifier->Notify(chrome::NOTIFICATION_HISTORY_URL_VISITED,
content::Source<Profile>(profile_),
content::Details<history::URLVisitedDetails>(&details));
20, 15, false,
&updated_visits));
details.row = twenty_visits;
- details.transition = content::PAGE_TRANSITION_TYPED;
+ details.transition = ui::PAGE_TRANSITION_TYPED;
notifier->Notify(chrome::NOTIFICATION_HISTORY_URL_VISITED,
content::Source<Profile>(profile_),
content::Details<history::URLVisitedDetails>(&details));
// Errors writing to the DB should be recorded, but should not cause an
// unrecoverable error.
ASSERT_FALSE(
- sync_service_->failed_data_types_handler().GetFailedTypes().Has(
+ sync_service_->data_type_status_table().GetFailedTypes().Has(
syncer::TYPED_URLS));
// Some calls should have succeeded, so the error percentage should be
// somewhere > 0 and < 100.
// Errors getting typed URLs will cause an unrecoverable error (since we can
// do *nothing* in that case).
ASSERT_TRUE(
- sync_service_->failed_data_types_handler().GetFailedTypes().Has(
+ sync_service_->data_type_status_table().GetFailedTypes().Has(
syncer::TYPED_URLS));
ASSERT_EQ(
- 1u, sync_service_->failed_data_types_handler().GetFailedTypes().Size());
+ 1u, sync_service_->data_type_status_table().GetFailedTypes().Size());
// Can't check GetErrorPercentage(), because generating an unrecoverable
// error will free the model associator.
}