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

Side by Side Diff: chrome/browser/signin/chrome_signin_status_metrics_provider_delegate_unittest.cc

Issue 1551503002: Convert Pass()→std::move() in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 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/signin/chrome_signin_status_metrics_provider_delegate.h " 5 #include "chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.h "
6 6
7 #include <utility>
8
7 #include "build/build_config.h" 9 #include "build/build_config.h"
8 #include "components/signin/core/browser/signin_status_metrics_provider.h" 10 #include "components/signin/core/browser/signin_status_metrics_provider.h"
9 #include "content/public/test/test_browser_thread_bundle.h" 11 #include "content/public/test/test_browser_thread_bundle.h"
10 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
11 13
12 #if !defined(OS_ANDROID) && !defined(OS_IOS) 14 #if !defined(OS_ANDROID) && !defined(OS_IOS)
13 TEST(ChromeSigninStatusMetricsProviderDelegateTest, 15 TEST(ChromeSigninStatusMetricsProviderDelegateTest,
14 UpdateStatusWhenBrowserAdded) { 16 UpdateStatusWhenBrowserAdded) {
15 content::TestBrowserThreadBundle thread_bundle; 17 content::TestBrowserThreadBundle thread_bundle;
16 18
17 scoped_ptr<ChromeSigninStatusMetricsProviderDelegate> delegate( 19 scoped_ptr<ChromeSigninStatusMetricsProviderDelegate> delegate(
18 new ChromeSigninStatusMetricsProviderDelegate); 20 new ChromeSigninStatusMetricsProviderDelegate);
19 ChromeSigninStatusMetricsProviderDelegate* raw_delegate = delegate.get(); 21 ChromeSigninStatusMetricsProviderDelegate* raw_delegate = delegate.get();
20 scoped_ptr<SigninStatusMetricsProvider> metrics_provider( 22 scoped_ptr<SigninStatusMetricsProvider> metrics_provider(
21 SigninStatusMetricsProvider::CreateInstance(delegate.Pass())); 23 SigninStatusMetricsProvider::CreateInstance(std::move(delegate)));
22 24
23 // Initial status is all signed in and then a signed-in browser is opened. 25 // Initial status is all signed in and then a signed-in browser is opened.
24 metrics_provider->UpdateInitialSigninStatusForTesting(2, 2); 26 metrics_provider->UpdateInitialSigninStatusForTesting(2, 2);
25 raw_delegate->UpdateStatusWhenBrowserAdded(true); 27 raw_delegate->UpdateStatusWhenBrowserAdded(true);
26 EXPECT_EQ(SigninStatusMetricsProviderBase::ALL_PROFILES_SIGNED_IN, 28 EXPECT_EQ(SigninStatusMetricsProviderBase::ALL_PROFILES_SIGNED_IN,
27 metrics_provider->GetSigninStatusForTesting()); 29 metrics_provider->GetSigninStatusForTesting());
28 30
29 // Initial status is all signed in and then a signed-out browser is opened. 31 // Initial status is all signed in and then a signed-out browser is opened.
30 metrics_provider->UpdateInitialSigninStatusForTesting(2, 2); 32 metrics_provider->UpdateInitialSigninStatusForTesting(2, 2);
31 raw_delegate->UpdateStatusWhenBrowserAdded(false); 33 raw_delegate->UpdateStatusWhenBrowserAdded(false);
(...skipping 18 matching lines...) Expand all
50 EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS, 52 EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
51 metrics_provider->GetSigninStatusForTesting()); 53 metrics_provider->GetSigninStatusForTesting());
52 54
53 // Initial status is mixed and then a signed-out browser is opened. 55 // Initial status is mixed and then a signed-out browser is opened.
54 metrics_provider->UpdateInitialSigninStatusForTesting(2, 1); 56 metrics_provider->UpdateInitialSigninStatusForTesting(2, 1);
55 raw_delegate->UpdateStatusWhenBrowserAdded(false); 57 raw_delegate->UpdateStatusWhenBrowserAdded(false);
56 EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS, 58 EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
57 metrics_provider->GetSigninStatusForTesting()); 59 metrics_provider->GetSigninStatusForTesting());
58 } 60 }
59 #endif 61 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698