| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 syncer::SyncDataList list = | 487 syncer::SyncDataList list = |
| 488 extension_sync_service()->GetAllSyncData(syncer::APPS); | 488 extension_sync_service()->GetAllSyncData(syncer::APPS); |
| 489 ASSERT_EQ(list.size(), 1U); | 489 ASSERT_EQ(list.size(), 1U); |
| 490 | 490 |
| 491 scoped_ptr<ExtensionSyncData> app_sync_data = | 491 scoped_ptr<ExtensionSyncData> app_sync_data = |
| 492 ExtensionSyncData::CreateFromSyncData(list[0]); | 492 ExtensionSyncData::CreateFromSyncData(list[0]); |
| 493 EXPECT_TRUE(initial_ordinal.Equals(app_sync_data->app_launch_ordinal())); | 493 EXPECT_TRUE(initial_ordinal.Equals(app_sync_data->app_launch_ordinal())); |
| 494 EXPECT_TRUE(initial_ordinal.Equals(app_sync_data->page_ordinal())); | 494 EXPECT_TRUE(initial_ordinal.Equals(app_sync_data->page_ordinal())); |
| 495 } | 495 } |
| 496 | 496 |
| 497 AppSorting* sorting = ExtensionPrefs::Get(profile())->app_sorting(); | 497 AppSorting* sorting = ExtensionSystem::Get(profile())->app_sorting(); |
| 498 sorting->SetAppLaunchOrdinal(app->id(), initial_ordinal.CreateAfter()); | 498 sorting->SetAppLaunchOrdinal(app->id(), initial_ordinal.CreateAfter()); |
| 499 { | 499 { |
| 500 syncer::SyncDataList list = | 500 syncer::SyncDataList list = |
| 501 extension_sync_service()->GetAllSyncData(syncer::APPS); | 501 extension_sync_service()->GetAllSyncData(syncer::APPS); |
| 502 ASSERT_EQ(list.size(), 1U); | 502 ASSERT_EQ(list.size(), 1U); |
| 503 | 503 |
| 504 scoped_ptr<ExtensionSyncData> app_sync_data = | 504 scoped_ptr<ExtensionSyncData> app_sync_data = |
| 505 ExtensionSyncData::CreateFromSyncData(list[0]); | 505 ExtensionSyncData::CreateFromSyncData(list[0]); |
| 506 ASSERT_TRUE(app_sync_data.get()); | 506 ASSERT_TRUE(app_sync_data.get()); |
| 507 EXPECT_TRUE(initial_ordinal.LessThan(app_sync_data->app_launch_ordinal())); | 507 EXPECT_TRUE(initial_ordinal.LessThan(app_sync_data->app_launch_ordinal())); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 } | 539 } |
| 540 | 540 |
| 541 syncer::FakeSyncChangeProcessor processor; | 541 syncer::FakeSyncChangeProcessor processor; |
| 542 extension_sync_service()->MergeDataAndStartSyncing( | 542 extension_sync_service()->MergeDataAndStartSyncing( |
| 543 syncer::APPS, | 543 syncer::APPS, |
| 544 syncer::SyncDataList(), | 544 syncer::SyncDataList(), |
| 545 scoped_ptr<syncer::SyncChangeProcessor>( | 545 scoped_ptr<syncer::SyncChangeProcessor>( |
| 546 new syncer::FakeSyncChangeProcessor), | 546 new syncer::FakeSyncChangeProcessor), |
| 547 scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); | 547 scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); |
| 548 | 548 |
| 549 ExtensionPrefs::Get(service()->GetBrowserContext()) | 549 ExtensionSystem::Get(service()->GetBrowserContext()) |
| 550 ->app_sorting() | 550 ->app_sorting() |
| 551 ->OnExtensionMoved(apps[0]->id(), apps[1]->id(), apps[2]->id()); | 551 ->OnExtensionMoved(apps[0]->id(), apps[1]->id(), apps[2]->id()); |
| 552 { | 552 { |
| 553 syncer::SyncDataList list = | 553 syncer::SyncDataList list = |
| 554 extension_sync_service()->GetAllSyncData(syncer::APPS); | 554 extension_sync_service()->GetAllSyncData(syncer::APPS); |
| 555 ASSERT_EQ(list.size(), 3U); | 555 ASSERT_EQ(list.size(), 3U); |
| 556 | 556 |
| 557 scoped_ptr<ExtensionSyncData> data[kAppCount]; | 557 scoped_ptr<ExtensionSyncData> data[kAppCount]; |
| 558 for (size_t i = 0; i < kAppCount; ++i) { | 558 for (size_t i = 0; i < kAppCount; ++i) { |
| 559 data[i] = ExtensionSyncData::CreateFromSyncData(list[i]); | 559 data[i] = ExtensionSyncData::CreateFromSyncData(list[i]); |
| (...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1710 // Uninstalling the extension without installed_by_custodian should have been | 1710 // Uninstalling the extension without installed_by_custodian should have been |
| 1711 // blocked by policy, so it should still be there. | 1711 // blocked by policy, so it should still be there. |
| 1712 EXPECT_TRUE(registry()->enabled_extensions().Contains(extension_ids[0])); | 1712 EXPECT_TRUE(registry()->enabled_extensions().Contains(extension_ids[0])); |
| 1713 | 1713 |
| 1714 // But installed_by_custodian should result in bypassing the policy check. | 1714 // But installed_by_custodian should result in bypassing the policy check. |
| 1715 EXPECT_FALSE( | 1715 EXPECT_FALSE( |
| 1716 registry()->GenerateInstalledExtensionsSet()->Contains(extension_ids[1])); | 1716 registry()->GenerateInstalledExtensionsSet()->Contains(extension_ids[1])); |
| 1717 } | 1717 } |
| 1718 | 1718 |
| 1719 #endif // defined(ENABLE_SUPERVISED_USERS) | 1719 #endif // defined(ENABLE_SUPERVISED_USERS) |
| OLD | NEW |