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

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

Issue 12434004: Move remaining Autofill code to //components/autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix long lines Created 7 years, 9 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/autofill/autocheckout_page_meta_data.h"
6 #include "testing/gtest/include/gtest/gtest.h"
7
8 namespace {
9
10 void SetPageDetails(autofill::AutocheckoutPageMetaData* meta_data,
11 int current_page,
12 int total) {
13 meta_data->current_page_number = current_page;
14 meta_data->total_pages = total;
15 }
16
17 } // namespace
18
19 namespace autofill {
20
21 TEST(AutocheckoutPageMetaDataTest, AutofillableFlow) {
22
23 AutocheckoutPageMetaData page_meta_data;
24 EXPECT_FALSE(page_meta_data.IsStartOfAutofillableFlow());
25 EXPECT_FALSE(page_meta_data.IsInAutofillableFlow());
26 EXPECT_FALSE(page_meta_data.IsEndOfAutofillableFlow());
27
28 SetPageDetails(&page_meta_data, -1, 0);
29 EXPECT_FALSE(page_meta_data.IsStartOfAutofillableFlow());
30 EXPECT_FALSE(page_meta_data.IsInAutofillableFlow());
31 EXPECT_FALSE(page_meta_data.IsEndOfAutofillableFlow());
32
33 SetPageDetails(&page_meta_data, 0, 0);
34 EXPECT_FALSE(page_meta_data.IsStartOfAutofillableFlow());
35 EXPECT_FALSE(page_meta_data.IsInAutofillableFlow());
36 EXPECT_FALSE(page_meta_data.IsEndOfAutofillableFlow());
37
38 SetPageDetails(&page_meta_data, 0, 1);
39 EXPECT_TRUE(page_meta_data.IsStartOfAutofillableFlow());
40 EXPECT_TRUE(page_meta_data.IsInAutofillableFlow());
41 EXPECT_TRUE(page_meta_data.IsEndOfAutofillableFlow());
42
43 SetPageDetails(&page_meta_data, 1, 2);
44 EXPECT_FALSE(page_meta_data.IsStartOfAutofillableFlow());
45 EXPECT_TRUE(page_meta_data.IsInAutofillableFlow());
46 EXPECT_TRUE(page_meta_data.IsEndOfAutofillableFlow());
47
48 SetPageDetails(&page_meta_data, 2, 2);
49 EXPECT_FALSE(page_meta_data.IsStartOfAutofillableFlow());
50 EXPECT_FALSE(page_meta_data.IsInAutofillableFlow());
51 EXPECT_FALSE(page_meta_data.IsEndOfAutofillableFlow());
52 }
53
54 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/autofill/autocheckout_page_meta_data.cc ('k') | chrome/browser/autofill/autocomplete_history_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698