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/views/passwords/manage_passwords_view_test.h" | 5 #include "chrome/browser/ui/views/passwords/manage_passwords_view_test.h" |
6 | 6 |
7 #include "base/test/statistics_delta_reader.h" | 7 #include "base/test/statistics_delta_reader.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/browser_command_controller.h" | 10 #include "chrome/browser/ui/browser_command_controller.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 NULL, &client, &driver, *test_form(), false)); | 72 NULL, &client, &driver, *test_form(), false)); |
73 controller()->OnPasswordSubmitted(test_form_manager.release()); | 73 controller()->OnPasswordSubmitted(test_form_manager.release()); |
74 | 74 |
75 // Wait for the command execution triggered by the automatic popup to pop up | 75 // Wait for the command execution triggered by the automatic popup to pop up |
76 // the bubble. | 76 // the bubble. |
77 content::RunAllPendingInMessageLoop(); | 77 content::RunAllPendingInMessageLoop(); |
78 controller()->UpdateIconAndBubbleState(view()); | 78 controller()->UpdateIconAndBubbleState(view()); |
79 } | 79 } |
80 | 80 |
81 void ManagePasswordsViewTest::SetupBlackistedPassword() { | 81 void ManagePasswordsViewTest::SetupBlackistedPassword() { |
82 controller()->OnBlacklistBlockedAutofill(); | 82 base::string16 kTestUsername = base::ASCIIToUTF16("test_username"); |
| 83 autofill::PasswordFormMap map; |
| 84 map[kTestUsername] = test_form(); |
| 85 controller()->OnBlacklistBlockedAutofill(map); |
83 controller()->UpdateIconAndBubbleState(view()); | 86 controller()->UpdateIconAndBubbleState(view()); |
84 } | 87 } |
85 | 88 |
86 base::HistogramSamples* ManagePasswordsViewTest::GetSamples( | 89 base::HistogramSamples* ManagePasswordsViewTest::GetSamples( |
87 const char* histogram) { | 90 const char* histogram) { |
88 // Ensure that everything has been properly recorded before pulling samples. | 91 // Ensure that everything has been properly recorded before pulling samples. |
89 content::RunAllPendingInMessageLoop(); | 92 content::RunAllPendingInMessageLoop(); |
90 return statistics_reader_.GetHistogramSamplesSinceCreation( | 93 return statistics_reader_.GetHistogramSamplesSinceCreation( |
91 histogram).release(); | 94 histogram).release(); |
92 } | 95 } |
OLD | NEW |