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" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 ManagePasswordsTest::~ManagePasswordsTest() { | 27 ManagePasswordsTest::~ManagePasswordsTest() { |
28 } | 28 } |
29 | 29 |
30 void ManagePasswordsTest::SetUpOnMainThread() { | 30 void ManagePasswordsTest::SetUpOnMainThread() { |
31 AddTabAtIndex(0, GURL("http://example.com/"), ui::PAGE_TRANSITION_TYPED); | 31 AddTabAtIndex(0, GURL("http://example.com/"), ui::PAGE_TRANSITION_TYPED); |
32 } | 32 } |
33 | 33 |
34 void ManagePasswordsTest::ExecuteManagePasswordsCommand() { | 34 void ManagePasswordsTest::ExecuteManagePasswordsCommand() { |
35 // Show the window to ensure that it's active. | 35 // Show the window to ensure that it's active. |
36 browser()->window()->Show(); | 36 browser()->window()->Show(false /* user_gesture */); |
37 | 37 |
38 CommandUpdater* updater = browser()->command_controller()->command_updater(); | 38 CommandUpdater* updater = browser()->command_controller()->command_updater(); |
39 EXPECT_TRUE(updater->IsCommandEnabled(IDC_MANAGE_PASSWORDS_FOR_PAGE)); | 39 EXPECT_TRUE(updater->IsCommandEnabled(IDC_MANAGE_PASSWORDS_FOR_PAGE)); |
40 EXPECT_TRUE(updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE)); | 40 EXPECT_TRUE(updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE)); |
41 | 41 |
42 // Wait for the command execution to pop up the bubble. | 42 // Wait for the command execution to pop up the bubble. |
43 content::RunAllPendingInMessageLoop(); | 43 content::RunAllPendingInMessageLoop(); |
44 } | 44 } |
45 | 45 |
46 void ManagePasswordsTest::SetupManagingPasswords() { | 46 void ManagePasswordsTest::SetupManagingPasswords() { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // Ensure that everything has been properly recorded before pulling samples. | 98 // Ensure that everything has been properly recorded before pulling samples. |
99 content::RunAllPendingInMessageLoop(); | 99 content::RunAllPendingInMessageLoop(); |
100 return histogram_tester_.GetHistogramSamplesSinceCreation(histogram) | 100 return histogram_tester_.GetHistogramSamplesSinceCreation(histogram) |
101 .release(); | 101 .release(); |
102 } | 102 } |
103 | 103 |
104 ManagePasswordsUIController* ManagePasswordsTest::GetController() { | 104 ManagePasswordsUIController* ManagePasswordsTest::GetController() { |
105 return ManagePasswordsUIController::FromWebContents( | 105 return ManagePasswordsUIController::FromWebContents( |
106 browser()->tab_strip_model()->GetActiveWebContents()); | 106 browser()->tab_strip_model()->GetActiveWebContents()); |
107 } | 107 } |
OLD | NEW |