Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2325)

Unified Diff: chrome/renderer/password_autocomplete_manager_unittest.cc

Issue 6151011: Introduce RenderView::Observer interface so that RenderView doesn't have to k... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/password_autocomplete_manager.cc ('k') | chrome/renderer/render_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/password_autocomplete_manager_unittest.cc
===================================================================
--- chrome/renderer/password_autocomplete_manager_unittest.cc (revision 71253)
+++ chrome/renderer/password_autocomplete_manager_unittest.cc (working copy)
@@ -5,6 +5,7 @@
#include "app/keyboard_codes.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
+#include "chrome/renderer/autofill_helper.h"
#include "chrome/renderer/password_autocomplete_manager.h"
#include "chrome/test/render_view_test.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -62,7 +63,7 @@
void SimulateOnFillPasswordForm(
const PasswordFormFillData& fill_data) {
ViewMsg_FillPasswordForm msg(0, fill_data);
- view_->OnMessageReceived(msg);
+ password_autocomplete_->OnMessageReceived(msg);
}
virtual void SetUp() {
@@ -117,7 +118,7 @@
username_element_.setValue(WebString::fromUTF8(username));
if (move_caret_to_end)
username_element_.setSelectionRange(username.length(), username.length());
- view_->textFieldDidChange(username_element_);
+ autofill_helper_->textFieldDidChange(username_element_);
// Processing is delayed because of a WebKit bug, see
// PasswordAutocompleteManager::TextDidChangeInTextField() for details.
MessageLoop::current()->RunAllPending();
@@ -127,7 +128,7 @@
app::KeyboardCode key_code) {
WebKit::WebKeyboardEvent key_event;
key_event.windowsKeyCode = key_code;
- view_->textFieldDidReceiveKeyDown(element, key_event);
+ autofill_helper_->textFieldDidReceiveKeyDown(element, key_event);
}
void CheckTextFieldsState(const std::string& username,
@@ -243,16 +244,16 @@
// Autocomplete should happen only when the username textfield is blurred with
// a full match.
username_element_.setValue("a");
- view_->textFieldDidEndEditing(username_element_);
+ autofill_helper_->textFieldDidEndEditing(username_element_);
CheckTextFieldsState("a", false, "", false);
username_element_.setValue("al");
- view_->textFieldDidEndEditing(username_element_);
+ autofill_helper_->textFieldDidEndEditing(username_element_);
CheckTextFieldsState("al", false, "", false);
username_element_.setValue("alices");
- view_->textFieldDidEndEditing(username_element_);
+ autofill_helper_->textFieldDidEndEditing(username_element_);
CheckTextFieldsState("alices", false, "", false);
username_element_.setValue(ASCIIToUTF16(kAliceUsername));
- view_->textFieldDidEndEditing(username_element_);
+ autofill_helper_->textFieldDidEndEditing(username_element_);
CheckTextFieldsState(kAliceUsername, true, kAlicePassword, true);
}
@@ -326,7 +327,7 @@
// WebView does: it sets the element value then calls
// didAcceptAutocompleteSuggestion on the renderer.
username_element_.setValue(ASCIIToUTF16(kAliceUsername));
- view_->didAcceptAutocompleteSuggestion(username_element_);
+ autofill_helper_->didAcceptAutocompleteSuggestion(username_element_);
// Autocomplete should have kicked in.
CheckTextFieldsState(kAliceUsername, true, kAlicePassword, true);
« no previous file with comments | « chrome/renderer/password_autocomplete_manager.cc ('k') | chrome/renderer/render_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698