OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/apps/ephemeral_app_browsertest.h" | 5 #include "chrome/browser/apps/ephemeral_app_browsertest.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "apps/app_restore_service.h" | 9 #include "apps/app_restore_service.h" |
10 #include "apps/saved_files_service.h" | 10 #include "apps/saved_files_service.h" |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 &mock_sync_processor_)), | 526 &mock_sync_processor_)), |
527 scoped_ptr<syncer::SyncErrorFactory>( | 527 scoped_ptr<syncer::SyncErrorFactory>( |
528 new syncer::SyncErrorFactoryMock())); | 528 new syncer::SyncErrorFactoryMock())); |
529 } | 529 } |
530 | 530 |
531 scoped_ptr<AppSyncData> GetLastSyncChangeForApp(const std::string& id) { | 531 scoped_ptr<AppSyncData> GetLastSyncChangeForApp(const std::string& id) { |
532 scoped_ptr<AppSyncData> sync_data; | 532 scoped_ptr<AppSyncData> sync_data; |
533 for (syncer::SyncChangeList::iterator it = | 533 for (syncer::SyncChangeList::iterator it = |
534 mock_sync_processor_.changes().begin(); | 534 mock_sync_processor_.changes().begin(); |
535 it != mock_sync_processor_.changes().end(); ++it) { | 535 it != mock_sync_processor_.changes().end(); ++it) { |
536 scoped_ptr<AppSyncData> data(new AppSyncData(*it)); | 536 scoped_ptr<AppSyncData> data(AppSyncData::CreateFromSyncChange(*it)); |
537 if (data->id() == id) | 537 if (data.get() && data->id() == id) |
538 sync_data.reset(data.release()); | 538 sync_data.reset(data.release()); |
539 } | 539 } |
540 | 540 |
541 return sync_data.Pass(); | 541 return sync_data.Pass(); |
542 } | 542 } |
543 | 543 |
544 void VerifySyncChange(const AppSyncData* sync_change, bool expect_enabled) { | 544 void VerifySyncChange(const AppSyncData* sync_change, bool expect_enabled) { |
545 if (!kEnableSync) | 545 if (!kEnableSync) |
546 return; | 546 return; |
547 | 547 |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1032 base::Bind(&PowerSaveBlockerStub::Create, &power_settings)); | 1032 base::Bind(&PowerSaveBlockerStub::Create, &power_settings)); |
1033 | 1033 |
1034 const Extension* app = InstallAndLaunchEphemeralApp(kPowerTestApp); | 1034 const Extension* app = InstallAndLaunchEphemeralApp(kPowerTestApp); |
1035 ASSERT_TRUE(app); | 1035 ASSERT_TRUE(app); |
1036 EXPECT_EQ(1, power_settings.keep_awake_count()); | 1036 EXPECT_EQ(1, power_settings.keep_awake_count()); |
1037 | 1037 |
1038 CloseAppWaitForUnload(app->id()); | 1038 CloseAppWaitForUnload(app->id()); |
1039 | 1039 |
1040 EXPECT_EQ(0, power_settings.keep_awake_count()); | 1040 EXPECT_EQ(0, power_settings.keep_awake_count()); |
1041 } | 1041 } |
OLD | NEW |