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

Side by Side Diff: chrome/browser/ui/cocoa/autofill/autofill_details_container_unittest.mm

Issue 85863003: Change DetailOutputMap to FieldValueMap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests Created 7 years 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #import "chrome/browser/ui/cocoa/autofill/autofill_details_container.h" 5 #import "chrome/browser/ui/cocoa/autofill/autofill_details_container.h"
6 6
7 #include "base/mac/scoped_nsobject.h" 7 #include "base/mac/scoped_nsobject.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #import "chrome/browser/ui/cocoa/autofill/autofill_section_container.h" 9 #import "chrome/browser/ui/cocoa/autofill/autofill_section_container.h"
10 #include "chrome/browser/ui/autofill/mock_autofill_dialog_view_delegate.h" 10 #include "chrome/browser/ui/autofill/mock_autofill_dialog_view_delegate.h"
(...skipping 26 matching lines...) Expand all
37 37
38 [[container_ view] setFrameSize:[container_ preferredSize]]; 38 [[container_ view] setFrameSize:[container_ preferredSize]];
39 EXPECT_GT(NSHeight([[container_ view] frame]), 0); 39 EXPECT_GT(NSHeight([[container_ view] frame]), 0);
40 EXPECT_GT(NSWidth([[container_ view] frame]), 0); 40 EXPECT_GT(NSWidth([[container_ view] frame]), 0);
41 } 41 }
42 42
43 TEST_F(AutofillDetailsContainerTest, ValidateAllSections) { 43 TEST_F(AutofillDetailsContainerTest, ValidateAllSections) {
44 using namespace autofill; 44 using namespace autofill;
45 using namespace testing; 45 using namespace testing;
46 46
47 DetailOutputMap output;
48 ValidityMessages validity; 47 ValidityMessages validity;
49 48
50 EXPECT_CALL(delegate_, InputsAreValid(_, _)) 49 EXPECT_CALL(delegate_, InputsAreValid(_, _))
51 .Times(3) 50 .Times(3)
52 .WillOnce(Return(validity)) 51 .WillOnce(Return(validity))
53 .WillOnce(Return(validity)) 52 .WillOnce(Return(validity))
54 .WillOnce(Return(validity)); 53 .WillOnce(Return(validity));
55 54
56 EXPECT_TRUE([container_ validate]); 55 EXPECT_TRUE([container_ validate]);
57 56
58 ValidityMessages invalid; 57 ValidityMessages invalid;
59 invalid.Set(ADDRESS_HOME_ZIP, 58 invalid.Set(ADDRESS_HOME_ZIP,
60 ValidityMessage(ASCIIToUTF16("Some error message"), false)); 59 ValidityMessage(ASCIIToUTF16("Some error message"), false));
61 60
62 EXPECT_CALL(delegate_, InputsAreValid(_, _)) 61 EXPECT_CALL(delegate_, InputsAreValid(_, _))
63 .Times(3) 62 .Times(3)
64 .WillOnce(Return(validity)) 63 .WillOnce(Return(validity))
65 .WillOnce(Return(validity)) 64 .WillOnce(Return(validity))
66 .WillOnce(Return(invalid)); 65 .WillOnce(Return(invalid));
67 66
68 EXPECT_FALSE([container_ validate]); 67 EXPECT_FALSE([container_ validate]);
69 } 68 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698