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/ui/sync/one_click_signin_sync_observer.h" | 5 #include "chrome/browser/ui/sync/one_click_signin_sync_observer.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 sync_active_(false) {} | 85 sync_active_(false) {} |
86 | 86 |
87 bool first_setup_in_progress_; | 87 bool first_setup_in_progress_; |
88 bool sync_active_; | 88 bool sync_active_; |
89 | 89 |
90 DISALLOW_COPY_AND_ASSIGN(OneClickTestProfileSyncService); | 90 DISALLOW_COPY_AND_ASSIGN(OneClickTestProfileSyncService); |
91 }; | 91 }; |
92 | 92 |
93 class TestOneClickSigninSyncObserver : public OneClickSigninSyncObserver { | 93 class TestOneClickSigninSyncObserver : public OneClickSigninSyncObserver { |
94 public: | 94 public: |
95 typedef base::Callback<void(TestOneClickSigninSyncObserver*)> | 95 using DestructionCallback = |
96 DestructionCallback; | 96 base::Callback<void(TestOneClickSigninSyncObserver*)>; |
97 | 97 |
98 TestOneClickSigninSyncObserver(content::WebContents* web_contents, | 98 TestOneClickSigninSyncObserver(content::WebContents* web_contents, |
99 const GURL& continue_url, | 99 const GURL& continue_url, |
100 const DestructionCallback& callback) | 100 const DestructionCallback& callback) |
101 : OneClickSigninSyncObserver(web_contents, continue_url), | 101 : OneClickSigninSyncObserver(web_contents, continue_url), |
102 destruction_callback_(callback) {} | 102 destruction_callback_(callback) {} |
103 ~TestOneClickSigninSyncObserver() override { | 103 ~TestOneClickSigninSyncObserver() override { |
104 destruction_callback_.Run(this); | 104 destruction_callback_.Run(this); |
105 } | 105 } |
106 | 106 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 if (content::IsBrowserSideNavigationEnabled()) { | 281 if (content::IsBrowserSideNavigationEnabled()) { |
282 EXPECT_CALL(*web_contents_observer_, DidStartNavigation(_)).Times(0); | 282 EXPECT_CALL(*web_contents_observer_, DidStartNavigation(_)).Times(0); |
283 sync_service_->NotifyObservers(); | 283 sync_service_->NotifyObservers(); |
284 } else { | 284 } else { |
285 EXPECT_CALL(*web_contents_observer_, | 285 EXPECT_CALL(*web_contents_observer_, |
286 DidStartNavigationToPendingEntry(_, _)).Times(0); | 286 DidStartNavigationToPendingEntry(_, _)).Times(0); |
287 sync_service_->NotifyObservers(); | 287 sync_service_->NotifyObservers(); |
288 } | 288 } |
289 EXPECT_NE(GURL(kContinueUrl), web_contents()->GetVisibleURL()); | 289 EXPECT_NE(GURL(kContinueUrl), web_contents()->GetVisibleURL()); |
290 } | 290 } |
OLD | NEW |