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/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/common/autofill_messages.h" | 10 #include "chrome/common/autofill_messages.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 decoration.simulateClick(); | 73 decoration.simulateClick(); |
74 } | 74 } |
75 | 75 |
76 bool DecorationIsVisible(WebKit::WebInputElement* input_element) { | 76 bool DecorationIsVisible(WebKit::WebInputElement* input_element) { |
77 WebKit::WebElement decoration = | 77 WebKit::WebElement decoration = |
78 input_element->decorationElementFor(generation_manager_.get()); | 78 input_element->decorationElementFor(generation_manager_.get()); |
79 return decoration.hasNonEmptyBoundingBox(); | 79 return decoration.hasNonEmptyBoundingBox(); |
80 } | 80 } |
81 | 81 |
82 void SetNotBlacklistedMessage(const char* form_str) { | 82 void SetNotBlacklistedMessage(const char* form_str) { |
83 webkit::forms::PasswordForm form; | 83 content::PasswordForm form; |
84 form.origin = | 84 form.origin = |
85 GURL(StringPrintf("data:text/html;charset=utf-8,%s",form_str)); | 85 GURL(StringPrintf("data:text/html;charset=utf-8,%s",form_str)); |
86 AutofillMsg_FormNotBlacklisted msg(0, form); | 86 AutofillMsg_FormNotBlacklisted msg(0, form); |
87 generation_manager_->OnMessageReceived(msg); | 87 generation_manager_->OnMessageReceived(msg); |
88 } | 88 } |
89 | 89 |
90 protected: | 90 protected: |
91 scoped_ptr<TestPasswordGenerationManager> generation_manager_; | 91 scoped_ptr<TestPasswordGenerationManager> generation_manager_; |
92 | 92 |
93 private: | 93 private: |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 ASSERT_FALSE(element.isNull()); | 269 ASSERT_FALSE(element.isNull()); |
270 first_password_element = element.to<WebInputElement>(); | 270 first_password_element = element.to<WebInputElement>(); |
271 EXPECT_TRUE(DecorationIsVisible(&first_password_element)); | 271 EXPECT_TRUE(DecorationIsVisible(&first_password_element)); |
272 SimulateClickOnDecoration(&first_password_element); | 272 SimulateClickOnDecoration(&first_password_element); |
273 EXPECT_EQ(2u, generation_manager_->messages().size()); | 273 EXPECT_EQ(2u, generation_manager_->messages().size()); |
274 EXPECT_EQ(AutofillHostMsg_ShowPasswordGenerationPopup::ID, | 274 EXPECT_EQ(AutofillHostMsg_ShowPasswordGenerationPopup::ID, |
275 generation_manager_->messages()[1]->type()); | 275 generation_manager_->messages()[1]->type()); |
276 } | 276 } |
277 | 277 |
278 } // namespace autofill | 278 } // namespace autofill |
OLD | NEW |