| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string.h> | 5 #include <string.h> |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/test/base/chrome_render_view_test.h" | 10 #include "chrome/test/base/chrome_render_view_test.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 input_element->decorationElementFor(generation_manager_.get()); | 90 input_element->decorationElementFor(generation_manager_.get()); |
| 91 return decoration.hasNonEmptyBoundingBox(); | 91 return decoration.hasNonEmptyBoundingBox(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void SetPasswordGenerationEnabledMessage(void) { | 94 void SetPasswordGenerationEnabledMessage(void) { |
| 95 AutofillMsg_PasswordGenerationEnabled msg(0, true); | 95 AutofillMsg_PasswordGenerationEnabled msg(0, true); |
| 96 generation_manager_->OnMessageReceived(msg); | 96 generation_manager_->OnMessageReceived(msg); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void SetNotBlacklistedMessage(const char* form_str) { | 99 void SetNotBlacklistedMessage(const char* form_str) { |
| 100 content::PasswordForm form; | 100 autofill::PasswordForm form; |
| 101 form.origin = | 101 form.origin = |
| 102 GURL(base::StringPrintf("data:text/html;charset=utf-8,%s", form_str)); | 102 GURL(base::StringPrintf("data:text/html;charset=utf-8,%s", form_str)); |
| 103 AutofillMsg_FormNotBlacklisted msg(0, form); | 103 AutofillMsg_FormNotBlacklisted msg(0, form); |
| 104 generation_manager_->OnMessageReceived(msg); | 104 generation_manager_->OnMessageReceived(msg); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void SetAccountCreationFormsDetectedMessage(const char* form_str) { | 107 void SetAccountCreationFormsDetectedMessage(const char* form_str) { |
| 108 autofill::FormData form; | 108 autofill::FormData form; |
| 109 form.origin = | 109 form.origin = |
| 110 GURL(base::StringPrintf("data:text/html;charset=utf-8,%s", form_str)); | 110 GURL(base::StringPrintf("data:text/html;charset=utf-8,%s", form_str)); |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 | 286 |
| 287 // Receive the account creation forms detected message. Show password | 287 // Receive the account creation forms detected message. Show password |
| 288 // generation icon. | 288 // generation icon. |
| 289 LoadHTML(kAccountCreationFormHTML); | 289 LoadHTML(kAccountCreationFormHTML); |
| 290 SetNotBlacklistedMessage(kAccountCreationFormHTML); | 290 SetNotBlacklistedMessage(kAccountCreationFormHTML); |
| 291 SetAccountCreationFormsDetectedMessage(kAccountCreationFormHTML); | 291 SetAccountCreationFormsDetectedMessage(kAccountCreationFormHTML); |
| 292 ExpectPasswordGenerationIconShown("first_password", true); | 292 ExpectPasswordGenerationIconShown("first_password", true); |
| 293 } | 293 } |
| 294 | 294 |
| 295 } // namespace autofill | 295 } // namespace autofill |
| OLD | NEW |