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_test.h" | 5 #include "chrome/browser/ui/passwords/manage_passwords_test.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
11 #include "chrome/browser/ui/browser_command_controller.h" | 11 #include "chrome/browser/ui/browser_command_controller.h" |
12 #include "chrome/browser/ui/browser_window.h" | 12 #include "chrome/browser/ui/browser_window.h" |
13 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" | 13 #include "chrome/browser/ui/passwords/passwords_client_ui_delegate.h" |
14 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
15 #include "chrome/test/base/in_process_browser_test.h" | 15 #include "chrome/test/base/in_process_browser_test.h" |
16 #include "chrome/test/base/interactive_test_utils.h" | 16 #include "chrome/test/base/interactive_test_utils.h" |
17 #include "components/autofill/core/common/password_form.h" | 17 #include "components/autofill/core/common/password_form.h" |
18 #include "components/password_manager/core/browser/password_form_manager.h" | 18 #include "components/password_manager/core/browser/password_form_manager.h" |
19 #include "components/password_manager/core/browser/password_manager_metrics_util
.h" | 19 #include "components/password_manager/core/browser/password_manager_metrics_util
.h" |
20 #include "components/password_manager/core/browser/stub_password_manager_client.
h" | 20 #include "components/password_manager/core/browser/stub_password_manager_client.
h" |
21 #include "components/password_manager/core/browser/stub_password_manager_driver.
h" | 21 #include "components/password_manager/core/browser/stub_password_manager_driver.
h" |
22 #include "testing/gtest/include/gtest/gtest.h" | |
23 | 22 |
24 ManagePasswordsTest::ManagePasswordsTest() { | 23 ManagePasswordsTest::ManagePasswordsTest() { |
25 } | 24 } |
26 | 25 |
27 ManagePasswordsTest::~ManagePasswordsTest() { | 26 ManagePasswordsTest::~ManagePasswordsTest() { |
28 } | 27 } |
29 | 28 |
30 void ManagePasswordsTest::SetUpOnMainThread() { | 29 void ManagePasswordsTest::SetUpOnMainThread() { |
31 AddTabAtIndex(0, GURL("http://example.com/"), ui::PAGE_TRANSITION_TYPED); | 30 AddTabAtIndex(0, GURL("http://example.com/"), ui::PAGE_TRANSITION_TYPED); |
32 } | 31 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 GetController()->OnAutoSignin(local_credentials.Pass()); | 93 GetController()->OnAutoSignin(local_credentials.Pass()); |
95 } | 94 } |
96 | 95 |
97 scoped_ptr<base::HistogramSamples> ManagePasswordsTest::GetSamples( | 96 scoped_ptr<base::HistogramSamples> ManagePasswordsTest::GetSamples( |
98 const char* histogram) { | 97 const char* histogram) { |
99 // Ensure that everything has been properly recorded before pulling samples. | 98 // Ensure that everything has been properly recorded before pulling samples. |
100 content::RunAllPendingInMessageLoop(); | 99 content::RunAllPendingInMessageLoop(); |
101 return histogram_tester_.GetHistogramSamplesSinceCreation(histogram).Pass(); | 100 return histogram_tester_.GetHistogramSamplesSinceCreation(histogram).Pass(); |
102 } | 101 } |
103 | 102 |
104 ManagePasswordsUIController* ManagePasswordsTest::GetController() { | 103 PasswordsClientUIDelegate* ManagePasswordsTest::GetController() { |
105 return ManagePasswordsUIController::FromWebContents( | 104 return PasswordsClientUIDelegateFromWebContents( |
106 browser()->tab_strip_model()->GetActiveWebContents()); | 105 browser()->tab_strip_model()->GetActiveWebContents()); |
107 } | 106 } |
OLD | NEW |