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/passwords/manage_passwords_ui_controller_mock.h" | 5 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller_mock.h" |
6 | 6 |
| 7 #include "base/memory/ptr_util.h" |
7 #include "components/password_manager/core/browser/password_form_manager.h" | 8 #include "components/password_manager/core/browser/password_form_manager.h" |
8 #include "components/password_manager/core/common/credential_manager_types.h" | 9 #include "components/password_manager/core/common/credential_manager_types.h" |
9 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
12 | 13 |
13 ManagePasswordsUIControllerMock::ManagePasswordsUIControllerMock( | 14 ManagePasswordsUIControllerMock::ManagePasswordsUIControllerMock( |
14 content::WebContents* contents) | 15 content::WebContents* contents) |
15 : ManagePasswordsUIController(contents) { | 16 : ManagePasswordsUIController(contents) { |
16 // Do not silently replace an existing ManagePasswordsUIController because it | 17 // Do not silently replace an existing ManagePasswordsUIController because it |
17 // unregisters itself in WebContentsDestroyed(). | 18 // unregisters itself in WebContentsDestroyed(). |
18 EXPECT_FALSE(contents->GetUserData(UserDataKey())); | 19 EXPECT_FALSE(contents->GetUserData(UserDataKey())); |
19 contents->SetUserData(UserDataKey(), this); | 20 contents->SetUserData(UserDataKey(), base::WrapUnique(this)); |
20 } | 21 } |
21 | 22 |
22 ManagePasswordsUIControllerMock::~ManagePasswordsUIControllerMock() {} | 23 ManagePasswordsUIControllerMock::~ManagePasswordsUIControllerMock() {} |
OLD | NEW |