Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(697)

Side by Side Diff: chrome/browser/chromeos/policy/affiliated_invalidation_service_provider_impl_unittest.cc

Issue 1557693002: Convert Pass()→std::move() in //chrome/browser/chromeos/policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "chrome/browser/chromeos/policy/affiliated_invalidation_service_provide r_impl.h" 5 #include "chrome/browser/chromeos/policy/affiliated_invalidation_service_provide r_impl.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility>
8 9
9 #include "base/macros.h" 10 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/chrome_notification_types.h" 12 #include "chrome/browser/chrome_notification_types.h"
12 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" 13 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
13 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" 14 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
14 #include "chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h" 15 #include "chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h"
15 #include "chrome/browser/chromeos/settings/cros_settings.h" 16 #include "chrome/browser/chromeos/settings/cros_settings.h"
16 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h " 17 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h "
17 #include "chrome/browser/chromeos/settings/device_settings_service.h" 18 #include "chrome/browser/chromeos/settings/device_settings_service.h"
(...skipping 25 matching lines...) Expand all
43 const char kAffiliatedUserID2[] = "test_2@example.com"; 44 const char kAffiliatedUserID2[] = "test_2@example.com";
44 const char kUnaffiliatedUserID[] = "test@other_domain.test"; 45 const char kUnaffiliatedUserID[] = "test@other_domain.test";
45 46
46 scoped_ptr<KeyedService> BuildProfileInvalidationProvider( 47 scoped_ptr<KeyedService> BuildProfileInvalidationProvider(
47 content::BrowserContext* context) { 48 content::BrowserContext* context) {
48 scoped_ptr<invalidation::FakeInvalidationService> invalidation_service( 49 scoped_ptr<invalidation::FakeInvalidationService> invalidation_service(
49 new invalidation::FakeInvalidationService); 50 new invalidation::FakeInvalidationService);
50 invalidation_service->SetInvalidatorState( 51 invalidation_service->SetInvalidatorState(
51 syncer::TRANSIENT_INVALIDATION_ERROR); 52 syncer::TRANSIENT_INVALIDATION_ERROR);
52 return make_scoped_ptr(new invalidation::ProfileInvalidationProvider( 53 return make_scoped_ptr(new invalidation::ProfileInvalidationProvider(
53 invalidation_service.Pass())); 54 std::move(invalidation_service)));
54 } 55 }
55 56
56 } // namespace 57 } // namespace
57 58
58 // A simple AffiliatedInvalidationServiceProvider::Consumer that registers a 59 // A simple AffiliatedInvalidationServiceProvider::Consumer that registers a
59 // syncer::FakeInvalidationHandler with the invalidation::InvalidationService 60 // syncer::FakeInvalidationHandler with the invalidation::InvalidationService
60 // that is currently being made available. 61 // that is currently being made available.
61 class FakeConsumer : public AffiliatedInvalidationServiceProvider::Consumer { 62 class FakeConsumer : public AffiliatedInvalidationServiceProvider::Consumer {
62 public: 63 public:
63 explicit FakeConsumer(AffiliatedInvalidationServiceProviderImpl* provider); 64 explicit FakeConsumer(AffiliatedInvalidationServiceProviderImpl* provider);
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 EXPECT_EQ(0, consumer_->GetAndClearInvalidationServiceSetCount()); 672 EXPECT_EQ(0, consumer_->GetAndClearInvalidationServiceSetCount());
672 provider_->Shutdown(); 673 provider_->Shutdown();
673 EXPECT_EQ(1, consumer_->GetAndClearInvalidationServiceSetCount()); 674 EXPECT_EQ(1, consumer_->GetAndClearInvalidationServiceSetCount());
674 EXPECT_EQ(nullptr, consumer_->GetInvalidationService()); 675 EXPECT_EQ(nullptr, consumer_->GetInvalidationService());
675 676
676 // Verify that the device-global invalidation service has been destroyed. 677 // Verify that the device-global invalidation service has been destroyed.
677 EXPECT_FALSE(provider_->GetDeviceInvalidationServiceForTest()); 678 EXPECT_FALSE(provider_->GetDeviceInvalidationServiceForTest());
678 } 679 }
679 680
680 } // namespace policy 681 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698