| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/metrics/user_metrics.h" | 10 #include "base/metrics/user_metrics.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 base::scoped_nsprotocol<id<NativeAppWhitelistManager>> manager_; | 44 base::scoped_nsprotocol<id<NativeAppWhitelistManager>> manager_; |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 class NativeAppNavigationControllerTest : public ChromeWebTest { | 47 class NativeAppNavigationControllerTest : public ChromeWebTest { |
| 48 protected: | 48 protected: |
| 49 void SetUp() override { | 49 void SetUp() override { |
| 50 ChromeWebTest::SetUp(); | 50 ChromeWebTest::SetUp(); |
| 51 controller_.reset([[NativeAppNavigationController alloc] | 51 controller_.reset( |
| 52 initWithWebState:web_state() | 52 [[NativeAppNavigationController alloc] initWithWebState:web_state()]); |
| 53 requestContextGetter:GetBrowserState()->GetRequestContext() | |
| 54 tab:nil]); | |
| 55 | 53 |
| 56 action_callback_ = | 54 action_callback_ = |
| 57 base::Bind(&NativeAppNavigationControllerTest::OnUserAction, | 55 base::Bind(&NativeAppNavigationControllerTest::OnUserAction, |
| 58 base::Unretained(this)); | 56 base::Unretained(this)); |
| 59 base::AddActionCallback(action_callback_); | 57 base::AddActionCallback(action_callback_); |
| 60 | 58 |
| 61 handler_called_counter_ = 0; | 59 handler_called_counter_ = 0; |
| 62 } | 60 } |
| 63 | 61 |
| 64 void TearDown() override { | 62 void TearDown() override { |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 DCHECK([[controller_ appsPossiblyBeingInstalled] count] == 2); | 198 DCHECK([[controller_ appsPossiblyBeingInstalled] count] == 2); |
| 201 [fakeManager setAppScheme:kMapsAppName]; | 199 [fakeManager setAppScheme:kMapsAppName]; |
| 202 [controller_ removeAppFromNotification:notificationMaps]; | 200 [controller_ removeAppFromNotification:notificationMaps]; |
| 203 DCHECK([[controller_ appsPossiblyBeingInstalled] count] == 1); | 201 DCHECK([[controller_ appsPossiblyBeingInstalled] count] == 1); |
| 204 [fakeManager setAppScheme:kYoutubeAppName]; | 202 [fakeManager setAppScheme:kYoutubeAppName]; |
| 205 [controller_ removeAppFromNotification:notificationYouTube]; | 203 [controller_ removeAppFromNotification:notificationYouTube]; |
| 206 DCHECK([[controller_ appsPossiblyBeingInstalled] count] == 0); | 204 DCHECK([[controller_ appsPossiblyBeingInstalled] count] == 0); |
| 207 } | 205 } |
| 208 | 206 |
| 209 } // namespace | 207 } // namespace |
| OLD | NEW |