OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <algorithm> | 5 #include <algorithm> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 EXPECT_TRUE(HasMessageMatchingID(AutofillMsg_SetAutofillActionPreview::ID)); | 245 EXPECT_TRUE(HasMessageMatchingID(AutofillMsg_SetAutofillActionPreview::ID)); |
246 } | 246 } |
247 | 247 |
248 TEST_F(AutofillDriverImplTest, FillActionSentToRenderer) { | 248 TEST_F(AutofillDriverImplTest, FillActionSentToRenderer) { |
249 driver_->SetRendererActionOnFormDataReception( | 249 driver_->SetRendererActionOnFormDataReception( |
250 AutofillDriver::FORM_DATA_ACTION_FILL); | 250 AutofillDriver::FORM_DATA_ACTION_FILL); |
251 EXPECT_TRUE(HasMessageMatchingID(AutofillMsg_SetAutofillActionFill::ID)); | 251 EXPECT_TRUE(HasMessageMatchingID(AutofillMsg_SetAutofillActionFill::ID)); |
252 } | 252 } |
253 | 253 |
254 TEST_F(AutofillDriverImplTest, AcceptDataListSuggestion) { | 254 TEST_F(AutofillDriverImplTest, AcceptDataListSuggestion) { |
255 base::string16 input_value(ASCIIToUTF16("barfoo")); | 255 base::string16 input_value(base::ASCIIToUTF16("barfoo")); |
256 base::string16 output_value; | 256 base::string16 output_value; |
257 driver_->RendererShouldAcceptDataListSuggestion(input_value); | 257 driver_->RendererShouldAcceptDataListSuggestion(input_value); |
258 EXPECT_TRUE(GetString16FromMessageWithID( | 258 EXPECT_TRUE(GetString16FromMessageWithID( |
259 AutofillMsg_AcceptDataListSuggestion::ID, | 259 AutofillMsg_AcceptDataListSuggestion::ID, |
260 &output_value)); | 260 &output_value)); |
261 EXPECT_EQ(input_value, output_value); | 261 EXPECT_EQ(input_value, output_value); |
262 } | 262 } |
263 | 263 |
264 TEST_F(AutofillDriverImplTest, AcceptPasswordAutofillSuggestion) { | 264 TEST_F(AutofillDriverImplTest, AcceptPasswordAutofillSuggestion) { |
265 base::string16 input_value(ASCIIToUTF16("barbaz")); | 265 base::string16 input_value(base::ASCIIToUTF16("barbaz")); |
266 base::string16 output_value; | 266 base::string16 output_value; |
267 driver_->RendererShouldAcceptPasswordAutofillSuggestion(input_value); | 267 driver_->RendererShouldAcceptPasswordAutofillSuggestion(input_value); |
268 EXPECT_TRUE(GetString16FromMessageWithID( | 268 EXPECT_TRUE(GetString16FromMessageWithID( |
269 AutofillMsg_AcceptPasswordAutofillSuggestion::ID, | 269 AutofillMsg_AcceptPasswordAutofillSuggestion::ID, |
270 &output_value)); | 270 &output_value)); |
271 EXPECT_EQ(input_value, output_value); | 271 EXPECT_EQ(input_value, output_value); |
272 } | 272 } |
273 | 273 |
274 TEST_F(AutofillDriverImplTest, ClearFilledFormSentToRenderer) { | 274 TEST_F(AutofillDriverImplTest, ClearFilledFormSentToRenderer) { |
275 driver_->RendererShouldClearFilledForm(); | 275 driver_->RendererShouldClearFilledForm(); |
276 EXPECT_TRUE(HasMessageMatchingID(AutofillMsg_ClearForm::ID)); | 276 EXPECT_TRUE(HasMessageMatchingID(AutofillMsg_ClearForm::ID)); |
277 } | 277 } |
278 | 278 |
279 TEST_F(AutofillDriverImplTest, ClearPreviewedFormSentToRenderer) { | 279 TEST_F(AutofillDriverImplTest, ClearPreviewedFormSentToRenderer) { |
280 driver_->RendererShouldClearPreviewedForm(); | 280 driver_->RendererShouldClearPreviewedForm(); |
281 EXPECT_TRUE(HasMessageMatchingID(AutofillMsg_ClearPreviewedForm::ID)); | 281 EXPECT_TRUE(HasMessageMatchingID(AutofillMsg_ClearPreviewedForm::ID)); |
282 } | 282 } |
283 | 283 |
284 TEST_F(AutofillDriverImplTest, SetNodeText) { | 284 TEST_F(AutofillDriverImplTest, SetNodeText) { |
285 base::string16 input_value(ASCIIToUTF16("barqux")); | 285 base::string16 input_value(base::ASCIIToUTF16("barqux")); |
286 base::string16 output_value; | 286 base::string16 output_value; |
287 driver_->RendererShouldSetNodeText(input_value); | 287 driver_->RendererShouldSetNodeText(input_value); |
288 EXPECT_TRUE(GetString16FromMessageWithID(AutofillMsg_SetNodeText::ID, | 288 EXPECT_TRUE(GetString16FromMessageWithID(AutofillMsg_SetNodeText::ID, |
289 &output_value)); | 289 &output_value)); |
290 EXPECT_EQ(input_value, output_value); | 290 EXPECT_EQ(input_value, output_value); |
291 } | 291 } |
292 | 292 |
293 } // namespace autofill | 293 } // namespace autofill |
OLD | NEW |