Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / sync / test / integration / migration_test.cc
index b1956c2..4682817 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2012 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
@@ -12,9 +12,9 @@
 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
 #include "chrome/browser/sync/test/integration/status_change_checker.h"
 #include "chrome/browser/sync/test/integration/sync_test.h"
-#include "chrome/browser/translate/translate_prefs.h"
 #include "chrome/common/pref_names.h"
 #include "chrome/test/base/ui_test_utils.h"
+#include "components/translate/core/browser/translate_prefs.h"
 
 using bookmarks_helper::AddURL;
 using bookmarks_helper::IndexedURL;
@@ -95,7 +95,13 @@ class MigrationChecker : public StatusChangeChecker,
                                                " does not contain ")
              << syncer::ModelTypeSetToString(expected_types_);
     return all_expected_types_migrated &&
-           !harness_->HasPendingBackendMigration();
+           !HasPendingBackendMigration();
+  }
+
+  bool HasPendingBackendMigration() const {
+    browser_sync::BackendMigrator* migrator =
+        harness_->service()->GetBackendMigratorForTest();
+    return migrator && migrator->state() != browser_sync::BackendMigrator::IDLE;
   }
 
   void set_expected_types(syncer::ModelTypeSet expected_types) {
@@ -107,7 +113,7 @@ class MigrationChecker : public StatusChangeChecker,
   }
 
   virtual void OnMigrationStateChange() OVERRIDE {
-    if (harness_->HasPendingBackendMigration()) {
+    if (HasPendingBackendMigration()) {
       // A new bunch of data types are in the process of being migrated. Merge
       // them into |pending_types_|.
       pending_types_.PutAll(
@@ -229,14 +235,6 @@ class MigrationTest : public SyncTest  {
       checker->set_expected_types(migrate_types);
       if (!checker->IsExitConditionSatisfied())
         ASSERT_TRUE(GetClient(i)->AwaitStatusChange(checker, "AwaitMigration"));
-      // We must use AwaitDataSyncCompletion rather than the more common
-      // AwaitFullSyncCompletion. As long as crbug.com/97780 is open, we will
-      // rely on self-notifications to ensure that progress markers are updated,
-      // which allows AwaitFullSyncCompletion to return. However, in some
-      // migration tests these notifications are completely disabled, so the
-      // progress markers do not get updated.  This is why we must use the less
-      // strict condition, AwaitDataSyncCompletion.
-      ASSERT_TRUE(GetClient(i)->AwaitDataSyncCompletion());
     }
   }