Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / sync / profile_sync_service_typed_url_unittest.cc
index 79eeb4e..238874b 100644 (file)
@@ -23,7 +23,6 @@
 #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"
@@ -45,6 +44,7 @@
 #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"
@@ -133,7 +133,7 @@ class HistoryServiceMock : public HistoryService {
 
   void set_task_runner(
       scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
-    DCHECK(task_runner);
+    DCHECK(task_runner.get());
     task_runner_ = task_runner;
   }
 
@@ -145,7 +145,7 @@ class HistoryServiceMock : public HistoryService {
   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_;
@@ -273,7 +273,7 @@ class ProfileSyncServiceTypedUrlTest : public AbstractProfileSyncServiceTest {
                                               data_type_controller,
                                               &error_handler_,
                                               &model_associator));
-      EXPECT_CALL(*components, CreateDataTypeManager(_, _, _, _, _, _)).
+      EXPECT_CALL(*components, CreateDataTypeManager(_, _, _, _, _)).
           WillOnce(ReturnNewDataTypeManager());
 
       ProfileOAuth2TokenService* oauth2_token_service =
@@ -352,7 +352,7 @@ class ProfileSyncServiceTypedUrlTest : public AbstractProfileSyncServiceTest {
     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;
   }
@@ -372,7 +372,7 @@ void AddTypedUrlEntries(ProfileSyncServiceTypedUrlTest* test,
     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);
   }
 }
@@ -527,7 +527,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, HasNativeHasSyncMerge) {
   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));
@@ -704,7 +704,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeAddFromVisit) {
 
   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,
@@ -743,7 +743,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeUpdateFromVisit) {
 
   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,
@@ -784,7 +784,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserIgnoreChangeUpdateFromVisit) {
   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,
@@ -803,7 +803,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserIgnoreChangeUpdateFromVisit) {
                                                   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));
@@ -818,7 +818,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserIgnoreChangeUpdateFromVisit) {
                                                   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));
@@ -970,7 +970,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, FailWriteToHistoryBackend) {
   // 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.
@@ -1004,10 +1004,10 @@ TEST_F(ProfileSyncServiceTypedUrlTest, FailToGetTypedURLs) {
   // 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.
 }