| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/sync/test/integration/apps_helper.h" | 10 #include "chrome/browser/sync/test/integration/apps_helper.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 } // namespace | 78 } // namespace |
| 79 | 79 |
| 80 class TwoClientAppListSyncTest : public SyncTest { | 80 class TwoClientAppListSyncTest : public SyncTest { |
| 81 public: | 81 public: |
| 82 TwoClientAppListSyncTest() : SyncTest(TWO_CLIENT_LEGACY) {} | 82 TwoClientAppListSyncTest() : SyncTest(TWO_CLIENT_LEGACY) {} |
| 83 | 83 |
| 84 virtual ~TwoClientAppListSyncTest() {} | 84 virtual ~TwoClientAppListSyncTest() {} |
| 85 | 85 |
| 86 // SyncTest | 86 // SyncTest |
| 87 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 87 virtual void SetUpCommandLine(CommandLine* command_line) override { |
| 88 SyncTest::SetUpCommandLine(command_line); | 88 SyncTest::SetUpCommandLine(command_line); |
| 89 command_line->AppendSwitch(app_list::switches::kEnableSyncAppList); | 89 command_line->AppendSwitch(app_list::switches::kEnableSyncAppList); |
| 90 } | 90 } |
| 91 | 91 |
| 92 virtual bool SetupClients() OVERRIDE { | 92 virtual bool SetupClients() override { |
| 93 if (!SyncTest::SetupClients()) | 93 if (!SyncTest::SetupClients()) |
| 94 return false; | 94 return false; |
| 95 | 95 |
| 96 // Init SyncAppListHelper to ensure that the extension system is initialized | 96 // Init SyncAppListHelper to ensure that the extension system is initialized |
| 97 // for each Profile. | 97 // for each Profile. |
| 98 SyncAppListHelper::GetInstance(); | 98 SyncAppListHelper::GetInstance(); |
| 99 return true; | 99 return true; |
| 100 } | 100 } |
| 101 | 101 |
| 102 virtual bool SetupSync() OVERRIDE { | 102 virtual bool SetupSync() override { |
| 103 if (!SyncTest::SetupSync()) | 103 if (!SyncTest::SetupSync()) |
| 104 return false; | 104 return false; |
| 105 WaitForExtensionServicesToLoad(); | 105 WaitForExtensionServicesToLoad(); |
| 106 return true; | 106 return true; |
| 107 } | 107 } |
| 108 | 108 |
| 109 private: | 109 private: |
| 110 void WaitForExtensionServicesToLoad() { | 110 void WaitForExtensionServicesToLoad() { |
| 111 for (int i = 0; i < num_clients(); ++i) | 111 for (int i = 0; i < num_clients(); ++i) |
| 112 WaitForExtensionsServiceToLoadForProfile(GetProfile(i)); | 112 WaitForExtensionsServiceToLoadForProfile(GetProfile(i)); |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 EXPECT_EQ(sync_pb::AppListSpecifics::TYPE_APP, sync_item->item_type); | 513 EXPECT_EQ(sync_pb::AppListSpecifics::TYPE_APP, sync_item->item_type); |
| 514 } | 514 } |
| 515 | 515 |
| 516 #if !defined(OS_MACOSX) | 516 #if !defined(OS_MACOSX) |
| 517 | 517 |
| 518 class TwoClientAppListSyncFolderTest : public TwoClientAppListSyncTest { | 518 class TwoClientAppListSyncFolderTest : public TwoClientAppListSyncTest { |
| 519 public: | 519 public: |
| 520 TwoClientAppListSyncFolderTest() {} | 520 TwoClientAppListSyncFolderTest() {} |
| 521 virtual ~TwoClientAppListSyncFolderTest() {} | 521 virtual ~TwoClientAppListSyncFolderTest() {} |
| 522 | 522 |
| 523 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 523 virtual void SetUpCommandLine(CommandLine* command_line) override { |
| 524 TwoClientAppListSyncTest::SetUpCommandLine(command_line); | 524 TwoClientAppListSyncTest::SetUpCommandLine(command_line); |
| 525 } | 525 } |
| 526 | 526 |
| 527 virtual bool SetupClients() OVERRIDE { | 527 virtual bool SetupClients() override { |
| 528 bool res = TwoClientAppListSyncTest::SetupClients(); | 528 bool res = TwoClientAppListSyncTest::SetupClients(); |
| 529 app_list::AppListSyncableService* verifier_service = | 529 app_list::AppListSyncableService* verifier_service = |
| 530 app_list::AppListSyncableServiceFactory::GetForProfile(verifier()); | 530 app_list::AppListSyncableServiceFactory::GetForProfile(verifier()); |
| 531 verifier_service->model()->SetFoldersEnabled(true); | 531 verifier_service->model()->SetFoldersEnabled(true); |
| 532 return res; | 532 return res; |
| 533 } | 533 } |
| 534 | 534 |
| 535 private: | 535 private: |
| 536 DISALLOW_COPY_AND_ASSIGN(TwoClientAppListSyncFolderTest); | 536 DISALLOW_COPY_AND_ASSIGN(TwoClientAppListSyncFolderTest); |
| 537 }; | 537 }; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 GetProfile(0), item_index, folder_id); | 616 GetProfile(0), item_index, folder_id); |
| 617 SyncAppListHelper::GetInstance()->MoveAppToFolder( | 617 SyncAppListHelper::GetInstance()->MoveAppToFolder( |
| 618 verifier(), item_index, folder_id); | 618 verifier(), item_index, folder_id); |
| 619 } | 619 } |
| 620 | 620 |
| 621 ASSERT_TRUE(AwaitQuiescence()); | 621 ASSERT_TRUE(AwaitQuiescence()); |
| 622 ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); | 622 ASSERT_TRUE(AllProfilesHaveSameAppListAsVerifier()); |
| 623 } | 623 } |
| 624 | 624 |
| 625 #endif // !defined(OS_MACOSX) | 625 #endif // !defined(OS_MACOSX) |
| OLD | NEW |