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/manage_passwords_ui_controller.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" | 22 #include "testing/gtest/include/gtest/gtest.h" |
23 | 23 |
| 24 ManagePasswordsTest::ManagePasswordsTest() { |
| 25 } |
| 26 |
| 27 ManagePasswordsTest::~ManagePasswordsTest() { |
| 28 } |
| 29 |
24 void ManagePasswordsTest::SetUpOnMainThread() { | 30 void ManagePasswordsTest::SetUpOnMainThread() { |
25 AddTabAtIndex(0, GURL("http://example.com/"), ui::PAGE_TRANSITION_TYPED); | 31 AddTabAtIndex(0, GURL("http://example.com/"), ui::PAGE_TRANSITION_TYPED); |
26 } | 32 } |
27 | 33 |
28 void ManagePasswordsTest::ExecuteManagePasswordsCommand() { | 34 void ManagePasswordsTest::ExecuteManagePasswordsCommand() { |
29 // Show the window to ensure that it's active. | 35 // Show the window to ensure that it's active. |
30 browser()->window()->Show(); | 36 browser()->window()->Show(); |
31 | 37 |
32 CommandUpdater* updater = browser()->command_controller()->command_updater(); | 38 CommandUpdater* updater = browser()->command_controller()->command_updater(); |
33 EXPECT_TRUE(updater->IsCommandEnabled(IDC_MANAGE_PASSWORDS_FOR_PAGE)); | 39 EXPECT_TRUE(updater->IsCommandEnabled(IDC_MANAGE_PASSWORDS_FOR_PAGE)); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // Ensure that everything has been properly recorded before pulling samples. | 92 // Ensure that everything has been properly recorded before pulling samples. |
87 content::RunAllPendingInMessageLoop(); | 93 content::RunAllPendingInMessageLoop(); |
88 return histogram_tester_.GetHistogramSamplesSinceCreation(histogram) | 94 return histogram_tester_.GetHistogramSamplesSinceCreation(histogram) |
89 .release(); | 95 .release(); |
90 } | 96 } |
91 | 97 |
92 ManagePasswordsUIController* ManagePasswordsTest::GetController() { | 98 ManagePasswordsUIController* ManagePasswordsTest::GetController() { |
93 return ManagePasswordsUIController::FromWebContents( | 99 return ManagePasswordsUIController::FromWebContents( |
94 browser()->tab_strip_model()->GetActiveWebContents()); | 100 browser()->tab_strip_model()->GetActiveWebContents()); |
95 } | 101 } |
OLD | NEW |