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/test/base/chrome_render_view_test.h" | 10 #include "chrome/test/base/chrome_render_view_test.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 content::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(base::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: |
94 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationManagerTest); | 94 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationManagerTest); |
95 }; | 95 }; |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 ASSERT_FALSE(element.isNull()); | 270 ASSERT_FALSE(element.isNull()); |
271 first_password_element = element.to<WebInputElement>(); | 271 first_password_element = element.to<WebInputElement>(); |
272 EXPECT_TRUE(DecorationIsVisible(&first_password_element)); | 272 EXPECT_TRUE(DecorationIsVisible(&first_password_element)); |
273 SimulateClickOnDecoration(&first_password_element); | 273 SimulateClickOnDecoration(&first_password_element); |
274 EXPECT_EQ(2u, generation_manager_->messages().size()); | 274 EXPECT_EQ(2u, generation_manager_->messages().size()); |
275 EXPECT_EQ(AutofillHostMsg_ShowPasswordGenerationPopup::ID, | 275 EXPECT_EQ(AutofillHostMsg_ShowPasswordGenerationPopup::ID, |
276 generation_manager_->messages()[1]->type()); | 276 generation_manager_->messages()[1]->type()); |
277 } | 277 } |
278 | 278 |
279 } // namespace autofill | 279 } // namespace autofill |
OLD | NEW |