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

Side by Side Diff: chrome/browser/autofill/autofill_manager_unittest.cc

Issue 2806089: Merge 54054 - Disable AutoFillManagerTest tests in branded builds.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <vector> 5 #include <vector>
6 6
7 #include "base/ref_counted.h" 7 #include "base/ref_counted.h"
8 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
9 #include "base/scoped_vector.h" 9 #include "base/scoped_vector.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 return true; 272 return true;
273 } 273 }
274 274
275 protected: 275 protected:
276 scoped_ptr<TestAutoFillManager> autofill_manager_; 276 scoped_ptr<TestAutoFillManager> autofill_manager_;
277 277
278 private: 278 private:
279 DISALLOW_COPY_AND_ASSIGN(AutoFillManagerTest); 279 DISALLOW_COPY_AND_ASSIGN(AutoFillManagerTest);
280 }; 280 };
281 281
282 TEST_F(AutoFillManagerTest, GetProfileSuggestionsEmptyValue) { 282 // TODO(georgey): All of these tests crash in official
283 // builds. http://crbug.com/50537
284 #if defined(GOOGLE_CHROME_BUILD)
285 #define SKIP_BRANDED(test) DISABLED_##test
286 #else
287 #define SKIP_BRANDED(test) test
288 #endif
289
290 TEST_F(AutoFillManagerTest, SKIP_BRANDED(GetProfileSuggestionsEmptyValue)) {
283 FormData form; 291 FormData form;
284 CreateTestFormData(&form); 292 CreateTestFormData(&form);
285 293
286 // Set up our FormStructures. 294 // Set up our FormStructures.
287 std::vector<FormData> forms; 295 std::vector<FormData> forms;
288 forms.push_back(form); 296 forms.push_back(form);
289 autofill_manager_->FormsSeen(forms); 297 autofill_manager_->FormsSeen(forms);
290 298
291 // The page ID sent to the AutoFillManager from the RenderView, used to send 299 // The page ID sent to the AutoFillManager from the RenderView, used to send
292 // an IPC message back to the renderer. 300 // an IPC message back to the renderer.
(...skipping 17 matching lines...) Expand all
310 ASSERT_EQ(2U, values.size()); 318 ASSERT_EQ(2U, values.size());
311 EXPECT_EQ(ASCIIToUTF16("Elvis"), values[0]); 319 EXPECT_EQ(ASCIIToUTF16("Elvis"), values[0]);
312 EXPECT_EQ(ASCIIToUTF16("Charles"), values[1]); 320 EXPECT_EQ(ASCIIToUTF16("Charles"), values[1]);
313 ASSERT_EQ(2U, labels.size()); 321 ASSERT_EQ(2U, labels.size());
314 // Inferred labels now include full first relevant field, which in this case 322 // Inferred labels now include full first relevant field, which in this case
315 // the address #1. 323 // the address #1.
316 EXPECT_EQ(ASCIIToUTF16("3734 Elvis Presley Blvd."), labels[0]); 324 EXPECT_EQ(ASCIIToUTF16("3734 Elvis Presley Blvd."), labels[0]);
317 EXPECT_EQ(ASCIIToUTF16("123 Apple St."), labels[1]); 325 EXPECT_EQ(ASCIIToUTF16("123 Apple St."), labels[1]);
318 } 326 }
319 327
320 TEST_F(AutoFillManagerTest, GetProfileSuggestionsMatchCharacter) { 328 TEST_F(AutoFillManagerTest, SKIP_BRANDED(GetProfileSuggestionsMatchCharacter)) {
321 FormData form; 329 FormData form;
322 CreateTestFormData(&form); 330 CreateTestFormData(&form);
323 331
324 // Set up our FormStructures. 332 // Set up our FormStructures.
325 std::vector<FormData> forms; 333 std::vector<FormData> forms;
326 forms.push_back(form); 334 forms.push_back(form);
327 autofill_manager_->FormsSeen(forms); 335 autofill_manager_->FormsSeen(forms);
328 336
329 // The page ID sent to the AutoFillManager from the RenderView, used to send 337 // The page ID sent to the AutoFillManager from the RenderView, used to send
330 // an IPC message back to the renderer. 338 // an IPC message back to the renderer.
(...skipping 13 matching lines...) Expand all
344 std::vector<string16> values; 352 std::vector<string16> values;
345 std::vector<string16> labels; 353 std::vector<string16> labels;
346 EXPECT_TRUE(GetAutoFillSuggestionsMessage(&page_id, &values, &labels)); 354 EXPECT_TRUE(GetAutoFillSuggestionsMessage(&page_id, &values, &labels));
347 EXPECT_EQ(kPageID, page_id); 355 EXPECT_EQ(kPageID, page_id);
348 ASSERT_EQ(1U, values.size()); 356 ASSERT_EQ(1U, values.size());
349 EXPECT_EQ(ASCIIToUTF16("Elvis"), values[0]); 357 EXPECT_EQ(ASCIIToUTF16("Elvis"), values[0]);
350 ASSERT_EQ(1U, labels.size()); 358 ASSERT_EQ(1U, labels.size());
351 EXPECT_EQ(ASCIIToUTF16("3734 Elvis Presley Blvd."), labels[0]); 359 EXPECT_EQ(ASCIIToUTF16("3734 Elvis Presley Blvd."), labels[0]);
352 } 360 }
353 361
354 TEST_F(AutoFillManagerTest, GetCreditCardSuggestionsEmptyValue) { 362 TEST_F(AutoFillManagerTest, SKIP_BRANDED(GetCreditCardSuggestionsEmptyValue)) {
355 FormData form; 363 FormData form;
356 CreateTestFormDataBilling(&form); 364 CreateTestFormDataBilling(&form);
357 365
358 // Set up our FormStructures. 366 // Set up our FormStructures.
359 std::vector<FormData> forms; 367 std::vector<FormData> forms;
360 forms.push_back(form); 368 forms.push_back(form);
361 autofill_manager_->FormsSeen(forms); 369 autofill_manager_->FormsSeen(forms);
362 370
363 // The page ID sent to the AutoFillManager from the RenderView, used to send 371 // The page ID sent to the AutoFillManager from the RenderView, used to send
364 // an IPC message back to the renderer. 372 // an IPC message back to the renderer.
(...skipping 23 matching lines...) Expand all
388 EXPECT_EQ(ASCIIToUTF16("************8765"), values[5]); 396 EXPECT_EQ(ASCIIToUTF16("************8765"), values[5]);
389 ASSERT_EQ(6U, labels.size()); 397 ASSERT_EQ(6U, labels.size());
390 EXPECT_EQ(ASCIIToUTF16("Home; 3456"), labels[0]); 398 EXPECT_EQ(ASCIIToUTF16("Home; 3456"), labels[0]);
391 EXPECT_EQ(ASCIIToUTF16("Work; 3456"), labels[1]); 399 EXPECT_EQ(ASCIIToUTF16("Work; 3456"), labels[1]);
392 EXPECT_EQ(ASCIIToUTF16("Empty; 3456"), labels[2]); 400 EXPECT_EQ(ASCIIToUTF16("Empty; 3456"), labels[2]);
393 EXPECT_EQ(ASCIIToUTF16("Home; 8765"), labels[3]); 401 EXPECT_EQ(ASCIIToUTF16("Home; 8765"), labels[3]);
394 EXPECT_EQ(ASCIIToUTF16("Work; 8765"), labels[4]); 402 EXPECT_EQ(ASCIIToUTF16("Work; 8765"), labels[4]);
395 EXPECT_EQ(ASCIIToUTF16("Empty; 8765"), labels[5]); 403 EXPECT_EQ(ASCIIToUTF16("Empty; 8765"), labels[5]);
396 } 404 }
397 405
398 TEST_F(AutoFillManagerTest, GetCreditCardSuggestionsMatchCharacter) { 406 TEST_F(AutoFillManagerTest,
407 SKIP_BRANDED(GetCreditCardSuggestionsMatchCharacter)) {
399 FormData form; 408 FormData form;
400 CreateTestFormDataBilling(&form); 409 CreateTestFormDataBilling(&form);
401 410
402 // Set up our FormStructures. 411 // Set up our FormStructures.
403 std::vector<FormData> forms; 412 std::vector<FormData> forms;
404 forms.push_back(form); 413 forms.push_back(form);
405 autofill_manager_->FormsSeen(forms); 414 autofill_manager_->FormsSeen(forms);
406 415
407 // The page ID sent to the AutoFillManager from the RenderView, used to send 416 // The page ID sent to the AutoFillManager from the RenderView, used to send
408 // an IPC message back to the renderer. 417 // an IPC message back to the renderer.
(...skipping 17 matching lines...) Expand all
426 ASSERT_EQ(3U, values.size()); 435 ASSERT_EQ(3U, values.size());
427 EXPECT_EQ(ASCIIToUTF16("************3456"), values[0]); 436 EXPECT_EQ(ASCIIToUTF16("************3456"), values[0]);
428 EXPECT_EQ(ASCIIToUTF16("************3456"), values[1]); 437 EXPECT_EQ(ASCIIToUTF16("************3456"), values[1]);
429 EXPECT_EQ(ASCIIToUTF16("************3456"), values[2]); 438 EXPECT_EQ(ASCIIToUTF16("************3456"), values[2]);
430 ASSERT_EQ(3U, labels.size()); 439 ASSERT_EQ(3U, labels.size());
431 EXPECT_EQ(ASCIIToUTF16("Home; 3456"), labels[0]); 440 EXPECT_EQ(ASCIIToUTF16("Home; 3456"), labels[0]);
432 EXPECT_EQ(ASCIIToUTF16("Work; 3456"), labels[1]); 441 EXPECT_EQ(ASCIIToUTF16("Work; 3456"), labels[1]);
433 EXPECT_EQ(ASCIIToUTF16("Empty; 3456"), labels[2]); 442 EXPECT_EQ(ASCIIToUTF16("Empty; 3456"), labels[2]);
434 } 443 }
435 444
436 TEST_F(AutoFillManagerTest, GetCreditCardSuggestionsNonCCNumber) { 445 TEST_F(AutoFillManagerTest, SKIP_BRANDED(GetCreditCardSuggestionsNonCCNumber)) {
437 FormData form; 446 FormData form;
438 CreateTestFormDataBilling(&form); 447 CreateTestFormDataBilling(&form);
439 448
440 // Set up our FormStructures. 449 // Set up our FormStructures.
441 std::vector<FormData> forms; 450 std::vector<FormData> forms;
442 forms.push_back(form); 451 forms.push_back(form);
443 autofill_manager_->FormsSeen(forms); 452 autofill_manager_->FormsSeen(forms);
444 453
445 // The page ID sent to the AutoFillManager from the RenderView, used to send 454 // The page ID sent to the AutoFillManager from the RenderView, used to send
446 // an IPC message back to the renderer. 455 // an IPC message back to the renderer.
(...skipping 23 matching lines...) Expand all
470 EXPECT_EQ(ASCIIToUTF16("Buddy Holly"), values[5]); 479 EXPECT_EQ(ASCIIToUTF16("Buddy Holly"), values[5]);
471 ASSERT_EQ(6U, labels.size()); 480 ASSERT_EQ(6U, labels.size());
472 EXPECT_EQ(ASCIIToUTF16("Home; 3456"), labels[0]); 481 EXPECT_EQ(ASCIIToUTF16("Home; 3456"), labels[0]);
473 EXPECT_EQ(ASCIIToUTF16("Work; 3456"), labels[1]); 482 EXPECT_EQ(ASCIIToUTF16("Work; 3456"), labels[1]);
474 EXPECT_EQ(ASCIIToUTF16("Empty; 3456"), labels[2]); 483 EXPECT_EQ(ASCIIToUTF16("Empty; 3456"), labels[2]);
475 EXPECT_EQ(ASCIIToUTF16("Home; 8765"), labels[3]); 484 EXPECT_EQ(ASCIIToUTF16("Home; 8765"), labels[3]);
476 EXPECT_EQ(ASCIIToUTF16("Work; 8765"), labels[4]); 485 EXPECT_EQ(ASCIIToUTF16("Work; 8765"), labels[4]);
477 EXPECT_EQ(ASCIIToUTF16("Empty; 8765"), labels[5]); 486 EXPECT_EQ(ASCIIToUTF16("Empty; 8765"), labels[5]);
478 } 487 }
479 488
480 TEST_F(AutoFillManagerTest, GetCreditCardSuggestionsSemicolon) { 489 TEST_F(AutoFillManagerTest, SKIP_BRANDED(GetCreditCardSuggestionsSemicolon)) {
481 // |profile| will be owned by the mock PersonalDataManager. 490 // |profile| will be owned by the mock PersonalDataManager.
482 AutoFillProfile* profile = new AutoFillProfile; 491 AutoFillProfile* profile = new AutoFillProfile;
483 autofill_unittest::SetProfileInfo(profile, "Home; 8765", "Joe", "", "Ely", 492 autofill_unittest::SetProfileInfo(profile, "Home; 8765", "Joe", "", "Ely",
484 "flatlander@gmail.com", "MCA", 493 "flatlander@gmail.com", "MCA",
485 "916 16th St.", "Apt. 6", "Lubbock", 494 "916 16th St.", "Apt. 6", "Lubbock",
486 "Texas", "79401", "USA", 495 "Texas", "79401", "USA",
487 "12345678901", ""); 496 "12345678901", "");
488 autofill_manager_->AddProfile(profile); 497 autofill_manager_->AddProfile(profile);
489 498
490 FormData form; 499 FormData form;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 EXPECT_EQ(ASCIIToUTF16("Home; 3456"), labels[0]); 536 EXPECT_EQ(ASCIIToUTF16("Home; 3456"), labels[0]);
528 EXPECT_EQ(ASCIIToUTF16("Work; 3456"), labels[1]); 537 EXPECT_EQ(ASCIIToUTF16("Work; 3456"), labels[1]);
529 EXPECT_EQ(ASCIIToUTF16("Empty; 3456"), labels[2]); 538 EXPECT_EQ(ASCIIToUTF16("Empty; 3456"), labels[2]);
530 EXPECT_EQ(ASCIIToUTF16("Home; 8765; 3456"), labels[3]); 539 EXPECT_EQ(ASCIIToUTF16("Home; 8765; 3456"), labels[3]);
531 EXPECT_EQ(ASCIIToUTF16("Home; 8765"), labels[4]); 540 EXPECT_EQ(ASCIIToUTF16("Home; 8765"), labels[4]);
532 EXPECT_EQ(ASCIIToUTF16("Work; 8765"), labels[5]); 541 EXPECT_EQ(ASCIIToUTF16("Work; 8765"), labels[5]);
533 EXPECT_EQ(ASCIIToUTF16("Empty; 8765"), labels[6]); 542 EXPECT_EQ(ASCIIToUTF16("Empty; 8765"), labels[6]);
534 EXPECT_EQ(ASCIIToUTF16("Home; 8765; 8765"), labels[7]); 543 EXPECT_EQ(ASCIIToUTF16("Home; 8765; 8765"), labels[7]);
535 } 544 }
536 545
537 TEST_F(AutoFillManagerTest, GetCreditCardSuggestionsNonHTTPS) { 546 TEST_F(AutoFillManagerTest, SKIP_BRANDED(GetCreditCardSuggestionsNonHTTPS)) {
538 FormData form; 547 FormData form;
539 CreateTestFormDataBilling(&form); 548 CreateTestFormDataBilling(&form);
540 form.origin = GURL("http://myform.com/form.html"); 549 form.origin = GURL("http://myform.com/form.html");
541 550
542 // Set up our FormStructures. 551 // Set up our FormStructures.
543 std::vector<FormData> forms; 552 std::vector<FormData> forms;
544 forms.push_back(form); 553 forms.push_back(form);
545 autofill_manager_->FormsSeen(forms); 554 autofill_manager_->FormsSeen(forms);
546 555
547 // The page ID sent to the AutoFillManager from the RenderView, used to send 556 // The page ID sent to the AutoFillManager from the RenderView, used to send
548 // an IPC message back to the renderer. 557 // an IPC message back to the renderer.
549 const int kPageID = 1; 558 const int kPageID = 1;
550 559
551 webkit_glue::FormField field; 560 webkit_glue::FormField field;
552 autofill_unittest::CreateTestFormField( 561 autofill_unittest::CreateTestFormField(
553 "Card Number", "cardnumber", "", "text", &field); 562 "Card Number", "cardnumber", "", "text", &field);
554 EXPECT_FALSE( 563 EXPECT_FALSE(
555 autofill_manager_->GetAutoFillSuggestions(kPageID, false, field)); 564 autofill_manager_->GetAutoFillSuggestions(kPageID, false, field));
556 } 565 }
557 566
558 TEST_F(AutoFillManagerTest, GetCombinedAutoFillAndAutocompleteSuggestions) { 567 TEST_F(AutoFillManagerTest,
568 SKIP_BRANDED(GetCombinedAutoFillAndAutocompleteSuggestions)) {
559 FormData form; 569 FormData form;
560 CreateTestFormData(&form); 570 CreateTestFormData(&form);
561 571
562 // Set up our FormStructures. 572 // Set up our FormStructures.
563 std::vector<FormData> forms; 573 std::vector<FormData> forms;
564 forms.push_back(form); 574 forms.push_back(form);
565 autofill_manager_->FormsSeen(forms); 575 autofill_manager_->FormsSeen(forms);
566 576
567 // The page ID sent to the AutoFillManager from the RenderView, used to send 577 // The page ID sent to the AutoFillManager from the RenderView, used to send
568 // an IPC message back to the renderer. 578 // an IPC message back to the renderer.
(...skipping 22 matching lines...) Expand all
591 EXPECT_EQ(ASCIIToUTF16("Charles"), values[1]); 601 EXPECT_EQ(ASCIIToUTF16("Charles"), values[1]);
592 EXPECT_EQ(ASCIIToUTF16("Jay"), values[2]); 602 EXPECT_EQ(ASCIIToUTF16("Jay"), values[2]);
593 EXPECT_EQ(ASCIIToUTF16("Jason"), values[3]); 603 EXPECT_EQ(ASCIIToUTF16("Jason"), values[3]);
594 ASSERT_EQ(4U, labels.size()); 604 ASSERT_EQ(4U, labels.size());
595 EXPECT_EQ(ASCIIToUTF16("3734 Elvis Presley Blvd."), labels[0]); 605 EXPECT_EQ(ASCIIToUTF16("3734 Elvis Presley Blvd."), labels[0]);
596 EXPECT_EQ(ASCIIToUTF16("123 Apple St."), labels[1]); 606 EXPECT_EQ(ASCIIToUTF16("123 Apple St."), labels[1]);
597 EXPECT_EQ(string16(), labels[2]); 607 EXPECT_EQ(string16(), labels[2]);
598 EXPECT_EQ(string16(), labels[3]); 608 EXPECT_EQ(string16(), labels[3]);
599 } 609 }
600 610
601 TEST_F(AutoFillManagerTest, GetFieldSuggestionsFormIsAutoFilled) { 611 TEST_F(AutoFillManagerTest, SKIP_BRANDED(GetFieldSuggestionsFormIsAutoFilled)) {
602 FormData form; 612 FormData form;
603 CreateTestFormData(&form); 613 CreateTestFormData(&form);
604 614
605 // Set up our FormStructures. 615 // Set up our FormStructures.
606 std::vector<FormData> forms; 616 std::vector<FormData> forms;
607 forms.push_back(form); 617 forms.push_back(form);
608 autofill_manager_->FormsSeen(forms); 618 autofill_manager_->FormsSeen(forms);
609 619
610 // The page ID sent to the AutoFillManager from the RenderView, used to send 620 // The page ID sent to the AutoFillManager from the RenderView, used to send
611 // an IPC message back to the renderer. 621 // an IPC message back to the renderer.
(...skipping 15 matching lines...) Expand all
627 EXPECT_TRUE(GetAutoFillSuggestionsMessage(&page_id, &values, &labels)); 637 EXPECT_TRUE(GetAutoFillSuggestionsMessage(&page_id, &values, &labels));
628 EXPECT_EQ(kPageID, page_id); 638 EXPECT_EQ(kPageID, page_id);
629 ASSERT_EQ(2U, values.size()); 639 ASSERT_EQ(2U, values.size());
630 EXPECT_EQ(ASCIIToUTF16("Elvis"), values[0]); 640 EXPECT_EQ(ASCIIToUTF16("Elvis"), values[0]);
631 EXPECT_EQ(ASCIIToUTF16("Charles"), values[1]); 641 EXPECT_EQ(ASCIIToUTF16("Charles"), values[1]);
632 ASSERT_EQ(2U, labels.size()); 642 ASSERT_EQ(2U, labels.size());
633 EXPECT_EQ(string16(), labels[0]); 643 EXPECT_EQ(string16(), labels[0]);
634 EXPECT_EQ(string16(), labels[1]); 644 EXPECT_EQ(string16(), labels[1]);
635 } 645 }
636 646
637 TEST_F(AutoFillManagerTest, GetFieldSuggestionsForAutocompleteOnly) { 647 TEST_F(AutoFillManagerTest,
648 SKIP_BRANDED(GetFieldSuggestionsForAutocompleteOnly)) {
638 FormData form; 649 FormData form;
639 CreateTestFormData(&form); 650 CreateTestFormData(&form);
640 651
641 // Set up our FormStructures. 652 // Set up our FormStructures.
642 std::vector<FormData> forms; 653 std::vector<FormData> forms;
643 forms.push_back(form); 654 forms.push_back(form);
644 autofill_manager_->FormsSeen(forms); 655 autofill_manager_->FormsSeen(forms);
645 656
646 // The page ID sent to the AutoFillManager from the RenderView, used to send 657 // The page ID sent to the AutoFillManager from the RenderView, used to send
647 // an IPC message back to the renderer. 658 // an IPC message back to the renderer.
(...skipping 15 matching lines...) Expand all
663 // Test that we sent the right message to the renderer. 674 // Test that we sent the right message to the renderer.
664 int page_id = 0; 675 int page_id = 0;
665 std::vector<string16> values; 676 std::vector<string16> values;
666 std::vector<string16> labels; 677 std::vector<string16> labels;
667 EXPECT_TRUE(GetAutoFillSuggestionsMessage(&page_id, &values, &labels)); 678 EXPECT_TRUE(GetAutoFillSuggestionsMessage(&page_id, &values, &labels));
668 EXPECT_EQ(kAlternatePageID, page_id); 679 EXPECT_EQ(kAlternatePageID, page_id);
669 ASSERT_EQ(0U, values.size()); 680 ASSERT_EQ(0U, values.size());
670 ASSERT_EQ(0U, labels.size()); 681 ASSERT_EQ(0U, labels.size());
671 } 682 }
672 683
673 TEST_F(AutoFillManagerTest, GetFieldSuggestionsWithDuplicateValues) { 684 TEST_F(AutoFillManagerTest,
685 SKIP_BRANDED(GetFieldSuggestionsWithDuplicateValues)) {
674 FormData form; 686 FormData form;
675 CreateTestFormData(&form); 687 CreateTestFormData(&form);
676 688
677 // Set up our FormStructures. 689 // Set up our FormStructures.
678 std::vector<FormData> forms; 690 std::vector<FormData> forms;
679 forms.push_back(form); 691 forms.push_back(form);
680 autofill_manager_->FormsSeen(forms); 692 autofill_manager_->FormsSeen(forms);
681 693
682 // |profile| will be owned by the mock PersonalDataManager. 694 // |profile| will be owned by the mock PersonalDataManager.
683 AutoFillProfile* profile = new AutoFillProfile; 695 AutoFillProfile* profile = new AutoFillProfile;
(...skipping 21 matching lines...) Expand all
705 EXPECT_TRUE(GetAutoFillSuggestionsMessage(&page_id, &values, &labels)); 717 EXPECT_TRUE(GetAutoFillSuggestionsMessage(&page_id, &values, &labels));
706 EXPECT_EQ(kPageID, page_id); 718 EXPECT_EQ(kPageID, page_id);
707 ASSERT_EQ(2U, values.size()); 719 ASSERT_EQ(2U, values.size());
708 EXPECT_EQ(ASCIIToUTF16("Elvis"), values[0]); 720 EXPECT_EQ(ASCIIToUTF16("Elvis"), values[0]);
709 EXPECT_EQ(ASCIIToUTF16("Charles"), values[1]); 721 EXPECT_EQ(ASCIIToUTF16("Charles"), values[1]);
710 ASSERT_EQ(2U, labels.size()); 722 ASSERT_EQ(2U, labels.size());
711 EXPECT_EQ(string16(), labels[0]); 723 EXPECT_EQ(string16(), labels[0]);
712 EXPECT_EQ(string16(), labels[1]); 724 EXPECT_EQ(string16(), labels[1]);
713 } 725 }
714 726
715 TEST_F(AutoFillManagerTest, FillCreditCardForm) { 727 TEST_F(AutoFillManagerTest, SKIP_BRANDED(FillCreditCardForm)) {
716 FormData form; 728 FormData form;
717 CreateTestFormDataBilling(&form); 729 CreateTestFormDataBilling(&form);
718 730
719 // Set up our FormStructures. 731 // Set up our FormStructures.
720 std::vector<FormData> forms; 732 std::vector<FormData> forms;
721 forms.push_back(form); 733 forms.push_back(form);
722 autofill_manager_->FormsSeen(forms); 734 autofill_manager_->FormsSeen(forms);
723 735
724 // The page ID sent to the AutoFillManager from the RenderView, used to send 736 // The page ID sent to the AutoFillManager from the RenderView, used to send
725 // an IPC message back to the renderer. 737 // an IPC message back to the renderer.
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 "Card Number", "cardnumber", "1234567890123456", "text", &field); 794 "Card Number", "cardnumber", "1234567890123456", "text", &field);
783 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[12])); 795 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[12]));
784 autofill_unittest::CreateTestFormField( 796 autofill_unittest::CreateTestFormField(
785 "Expiration Date", "ccmonth", "04", "text", &field); 797 "Expiration Date", "ccmonth", "04", "text", &field);
786 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[13])); 798 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[13]));
787 autofill_unittest::CreateTestFormField( 799 autofill_unittest::CreateTestFormField(
788 "", "ccyear", "2012", "text", &field); 800 "", "ccyear", "2012", "text", &field);
789 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[14])); 801 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[14]));
790 } 802 }
791 803
792 TEST_F(AutoFillManagerTest, FillNonBillingFormSemicolon) { 804 TEST_F(AutoFillManagerTest, SKIP_BRANDED(FillNonBillingFormSemicolon)) {
793 // |profile| will be owned by the mock PersonalDataManager. 805 // |profile| will be owned by the mock PersonalDataManager.
794 AutoFillProfile* profile = new AutoFillProfile; 806 AutoFillProfile* profile = new AutoFillProfile;
795 autofill_unittest::SetProfileInfo(profile, "Home; 8765", "Joe", "", "Ely", 807 autofill_unittest::SetProfileInfo(profile, "Home; 8765", "Joe", "", "Ely",
796 "flatlander@gmail.com", "MCA", 808 "flatlander@gmail.com", "MCA",
797 "916 16th St.", "Apt. 6", "Lubbock", 809 "916 16th St.", "Apt. 6", "Lubbock",
798 "Texas", "79401", "USA", 810 "Texas", "79401", "USA",
799 "12345678901", ""); 811 "12345678901", "");
800 profile->set_unique_id(6); 812 profile->set_unique_id(6);
801 autofill_manager_->AddProfile(profile); 813 autofill_manager_->AddProfile(profile);
802 814
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 "Country", "country", "USA", "text", &field); 868 "Country", "country", "USA", "text", &field);
857 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[8])); 869 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[8]));
858 autofill_unittest::CreateTestFormField( 870 autofill_unittest::CreateTestFormField(
859 "Phone Number", "phonenumber", "12345678901", "text", &field); 871 "Phone Number", "phonenumber", "12345678901", "text", &field);
860 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[9])); 872 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[9]));
861 autofill_unittest::CreateTestFormField( 873 autofill_unittest::CreateTestFormField(
862 "Email", "email", "flatlander@gmail.com", "text", &field); 874 "Email", "email", "flatlander@gmail.com", "text", &field);
863 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[10])); 875 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[10]));
864 } 876 }
865 877
866 TEST_F(AutoFillManagerTest, FillBillFormSemicolon) { 878 TEST_F(AutoFillManagerTest, SKIP_BRANDED(FillBillFormSemicolon)) {
867 // |profile| will be owned by the mock PersonalDataManager. 879 // |profile| will be owned by the mock PersonalDataManager.
868 AutoFillProfile* profile = new AutoFillProfile; 880 AutoFillProfile* profile = new AutoFillProfile;
869 autofill_unittest::SetProfileInfo(profile, "Home; 8765", "Joe", "", "Ely", 881 autofill_unittest::SetProfileInfo(profile, "Home; 8765", "Joe", "", "Ely",
870 "flatlander@gmail.com", "MCA", 882 "flatlander@gmail.com", "MCA",
871 "916 16th St.", "Apt. 6", "Lubbock", 883 "916 16th St.", "Apt. 6", "Lubbock",
872 "Texas", "79401", "USA", 884 "Texas", "79401", "USA",
873 "12345678901", ""); 885 "12345678901", "");
874 profile->set_unique_id(6); 886 profile->set_unique_id(6);
875 autofill_manager_->AddProfile(profile); 887 autofill_manager_->AddProfile(profile);
876 888
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 "Card Number", "cardnumber", "1234567890123456", "text", &field); 951 "Card Number", "cardnumber", "1234567890123456", "text", &field);
940 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[12])); 952 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[12]));
941 autofill_unittest::CreateTestFormField( 953 autofill_unittest::CreateTestFormField(
942 "Expiration Date", "ccmonth", "04", "text", &field); 954 "Expiration Date", "ccmonth", "04", "text", &field);
943 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[13])); 955 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[13]));
944 autofill_unittest::CreateTestFormField( 956 autofill_unittest::CreateTestFormField(
945 "", "ccyear", "2012", "text", &field); 957 "", "ccyear", "2012", "text", &field);
946 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[14])); 958 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[14]));
947 } 959 }
948 960
949 TEST_F(AutoFillManagerTest, FillPhoneNumber) { 961 TEST_F(AutoFillManagerTest, SKIP_BRANDED(FillPhoneNumber)) {
950 FormData form; 962 FormData form;
951 963
952 form.name = ASCIIToUTF16("MyPhoneForm"); 964 form.name = ASCIIToUTF16("MyPhoneForm");
953 form.method = ASCIIToUTF16("POST"); 965 form.method = ASCIIToUTF16("POST");
954 form.origin = GURL("http://myform.com/phone_form.html"); 966 form.origin = GURL("http://myform.com/phone_form.html");
955 form.action = GURL("http://myform.com/phone_submit.html"); 967 form.action = GURL("http://myform.com/phone_submit.html");
956 968
957 webkit_glue::FormField field; 969 webkit_glue::FormField field;
958 970
959 autofill_unittest::CreateTestFormField( 971 autofill_unittest::CreateTestFormField(
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 } else { 1023 } else {
1012 // The only size that is parsed and split, right now is 7: 1024 // The only size that is parsed and split, right now is 7:
1013 EXPECT_EQ(ASCIIToUTF16("123"), results.fields[2].value()); 1025 EXPECT_EQ(ASCIIToUTF16("123"), results.fields[2].value());
1014 EXPECT_EQ(ASCIIToUTF16("4567"), results.fields[3].value()); 1026 EXPECT_EQ(ASCIIToUTF16("4567"), results.fields[3].value());
1015 } 1027 }
1016 } 1028 }
1017 1029
1018 work_profile->SetInfo(phone_type, saved_phone); 1030 work_profile->SetInfo(phone_type, saved_phone);
1019 } 1031 }
1020 1032
1021 TEST_F(AutoFillManagerTest, FormChangesRemoveField) { 1033 TEST_F(AutoFillManagerTest, SKIP_BRANDED(FormChangesRemoveField)) {
1022 FormData form; 1034 FormData form;
1023 form.name = ASCIIToUTF16("MyForm"); 1035 form.name = ASCIIToUTF16("MyForm");
1024 form.method = ASCIIToUTF16("POST"); 1036 form.method = ASCIIToUTF16("POST");
1025 form.origin = GURL("http://myform.com/form.html"); 1037 form.origin = GURL("http://myform.com/form.html");
1026 form.action = GURL("http://myform.com/submit.html"); 1038 form.action = GURL("http://myform.com/submit.html");
1027 1039
1028 webkit_glue::FormField field; 1040 webkit_glue::FormField field;
1029 autofill_unittest::CreateTestFormField( 1041 autofill_unittest::CreateTestFormField(
1030 "First Name", "firstname", "", "text", &field); 1042 "First Name", "firstname", "", "text", &field);
1031 form.fields.push_back(field); 1043 form.fields.push_back(field);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 "Middle Name", "middlename", "Aaron", "text", &field); 1088 "Middle Name", "middlename", "Aaron", "text", &field);
1077 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[1])); 1089 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[1]));
1078 autofill_unittest::CreateTestFormField( 1090 autofill_unittest::CreateTestFormField(
1079 "Last Name", "lastname", "Presley", "text", &field); 1091 "Last Name", "lastname", "Presley", "text", &field);
1080 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[2])); 1092 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[2]));
1081 autofill_unittest::CreateTestFormField( 1093 autofill_unittest::CreateTestFormField(
1082 "Email", "email", "theking@gmail.com", "text", &field); 1094 "Email", "email", "theking@gmail.com", "text", &field);
1083 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[3])); 1095 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[3]));
1084 } 1096 }
1085 1097
1086 TEST_F(AutoFillManagerTest, FormChangesAddField) { 1098 TEST_F(AutoFillManagerTest, SKIP_BRANDED(FormChangesAddField)) {
1087 FormData form; 1099 FormData form;
1088 form.name = ASCIIToUTF16("MyForm"); 1100 form.name = ASCIIToUTF16("MyForm");
1089 form.method = ASCIIToUTF16("POST"); 1101 form.method = ASCIIToUTF16("POST");
1090 form.origin = GURL("http://myform.com/form.html"); 1102 form.origin = GURL("http://myform.com/form.html");
1091 form.action = GURL("http://myform.com/submit.html"); 1103 form.action = GURL("http://myform.com/submit.html");
1092 1104
1093 webkit_glue::FormField field; 1105 webkit_glue::FormField field;
1094 autofill_unittest::CreateTestFormField( 1106 autofill_unittest::CreateTestFormField(
1095 "First Name", "firstname", "", "text", &field); 1107 "First Name", "firstname", "", "text", &field);
1096 form.fields.push_back(field); 1108 form.fields.push_back(field);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 "Last Name", "lastname", "Presley", "text", &field); 1156 "Last Name", "lastname", "Presley", "text", &field);
1145 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[2])); 1157 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[2]));
1146 autofill_unittest::CreateTestFormField( 1158 autofill_unittest::CreateTestFormField(
1147 "Phone Number", "phonenumber", "", "text", &field); 1159 "Phone Number", "phonenumber", "", "text", &field);
1148 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[3])); 1160 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[3]));
1149 autofill_unittest::CreateTestFormField( 1161 autofill_unittest::CreateTestFormField(
1150 "Email", "email", "theking@gmail.com", "text", &field); 1162 "Email", "email", "theking@gmail.com", "text", &field);
1151 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[4])); 1163 EXPECT_TRUE(field.StrictlyEqualsHack(results.fields[4]));
1152 } 1164 }
1153 1165
1154 TEST_F(AutoFillManagerTest, HiddenFields) { 1166 TEST_F(AutoFillManagerTest, SKIP_BRANDED(HiddenFields)) {
1155 FormData form; 1167 FormData form;
1156 form.name = ASCIIToUTF16("MyForm"); 1168 form.name = ASCIIToUTF16("MyForm");
1157 form.method = ASCIIToUTF16("POST"); 1169 form.method = ASCIIToUTF16("POST");
1158 form.origin = GURL("http://myform.com/form.html"); 1170 form.origin = GURL("http://myform.com/form.html");
1159 form.action = GURL("http://myform.com/submit.html"); 1171 form.action = GURL("http://myform.com/submit.html");
1160 1172
1161 webkit_glue::FormField field; 1173 webkit_glue::FormField field;
1162 autofill_unittest::CreateTestFormField( 1174 autofill_unittest::CreateTestFormField(
1163 "E-mail", "one", "one", "hidden", &field); 1175 "E-mail", "one", "one", "hidden", &field);
1164 form.fields.push_back(field); 1176 form.fields.push_back(field);
(...skipping 10 matching lines...) Expand all
1175 autofill_manager_->FormsSeen(forms); 1187 autofill_manager_->FormsSeen(forms);
1176 1188
1177 // Submit the form. 1189 // Submit the form.
1178 autofill_manager_->FormSubmitted(form); 1190 autofill_manager_->FormSubmitted(form);
1179 1191
1180 // TODO(jhawkins): We can't use the InfoBar anymore to determine if we saved 1192 // TODO(jhawkins): We can't use the InfoBar anymore to determine if we saved
1181 // fields. Need to query the PDM. 1193 // fields. Need to query the PDM.
1182 } 1194 }
1183 1195
1184 } // namespace 1196 } // namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698