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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 decoration.simulateClick(); | 79 decoration.simulateClick(); |
80 } | 80 } |
81 | 81 |
82 bool DecorationIsVisible(WebKit::WebInputElement* input_element) { | 82 bool DecorationIsVisible(WebKit::WebInputElement* input_element) { |
83 WebKit::WebElement decoration = | 83 WebKit::WebElement decoration = |
84 input_element->decorationElementFor(generation_manager_.get()); | 84 input_element->decorationElementFor(generation_manager_.get()); |
85 return decoration.hasNonEmptyBoundingBox(); | 85 return decoration.hasNonEmptyBoundingBox(); |
86 } | 86 } |
87 | 87 |
88 void SetNotBlacklistedMessage(const char* form_str) { | 88 void SetNotBlacklistedMessage(const char* form_str) { |
89 content::PasswordForm form; | 89 autofill::PasswordForm form; |
90 form.origin = | 90 form.origin = |
91 GURL(base::StringPrintf("data:text/html;charset=utf-8,%s", form_str)); | 91 GURL(base::StringPrintf("data:text/html;charset=utf-8,%s", form_str)); |
92 AutofillMsg_FormNotBlacklisted msg(0, form); | 92 AutofillMsg_FormNotBlacklisted msg(0, form); |
93 generation_manager_->OnMessageReceived(msg); | 93 generation_manager_->OnMessageReceived(msg); |
94 } | 94 } |
95 | 95 |
96 protected: | 96 protected: |
97 scoped_ptr<TestPasswordGenerationManager> generation_manager_; | 97 scoped_ptr<TestPasswordGenerationManager> generation_manager_; |
98 | 98 |
99 private: | 99 private: |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 ASSERT_FALSE(element.isNull()); | 276 ASSERT_FALSE(element.isNull()); |
277 first_password_element = element.to<WebInputElement>(); | 277 first_password_element = element.to<WebInputElement>(); |
278 EXPECT_TRUE(DecorationIsVisible(&first_password_element)); | 278 EXPECT_TRUE(DecorationIsVisible(&first_password_element)); |
279 SimulateClickOnDecoration(&first_password_element); | 279 SimulateClickOnDecoration(&first_password_element); |
280 EXPECT_EQ(2u, generation_manager_->messages().size()); | 280 EXPECT_EQ(2u, generation_manager_->messages().size()); |
281 EXPECT_EQ(AutofillHostMsg_ShowPasswordGenerationPopup::ID, | 281 EXPECT_EQ(AutofillHostMsg_ShowPasswordGenerationPopup::ID, |
282 generation_manager_->messages()[1]->type()); | 282 generation_manager_->messages()[1]->type()); |
283 } | 283 } |
284 | 284 |
285 } // namespace autofill | 285 } // namespace autofill |
OLD | NEW |