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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_counter_utils_unittest.cc

Issue 1581173004: Added namespace browsing_data_counter_utils Base URL: https://chromium.googlesource.com/chromium/src.git@add-counters
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/browsing_data/browsing_data_counter_utils.h" 5 #include "chrome/browser/browsing_data/browsing_data_counter_utils.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/browsing_data/autofill_counter.h" 9 #include "chrome/browser/browsing_data/autofill_counter.h"
10 #include "chrome/test/base/testing_browser_process.h" 10 #include "chrome/test/base/testing_browser_process.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace browsing_data_counter_utils {
14
13 // Tests the complex output of the Autofill counter. 15 // Tests the complex output of the Autofill counter.
14 TEST(BrowsingDataCounterUtilsTest, AutofillCounterResult) { 16 TEST(BrowsingDataCounterUtilsTest, AutofillCounterResult) {
15 AutofillCounter counter; 17 AutofillCounter counter;
16 18
17 // This test assumes that the strings are served exactly as defined, 19 // This test assumes that the strings are served exactly as defined,
18 // i.e. that the locale is set to the default "en". 20 // i.e. that the locale is set to the default "en".
19 ASSERT_EQ("en", TestingBrowserProcess::GetGlobal()->GetApplicationLocale()); 21 ASSERT_EQ("en", TestingBrowserProcess::GetGlobal()->GetApplicationLocale());
20 22
21 // Test all configurations of zero and nonzero partial results for datatypes. 23 // Test all configurations of zero and nonzero partial results for datatypes.
22 // Test singular and plural for each datatype. 24 // Test singular and plural for each datatype.
(...skipping 27 matching lines...) Expand all
50 "%d address(es), %d suggestion(s).", 52 "%d address(es), %d suggestion(s).",
51 test_case.num_credit_cards, 53 test_case.num_credit_cards,
52 test_case.num_addresses, 54 test_case.num_addresses,
53 test_case.num_suggestions 55 test_case.num_suggestions
54 )); 56 ));
55 57
56 base::string16 output = GetCounterTextFromResult(&result); 58 base::string16 output = GetCounterTextFromResult(&result);
57 EXPECT_EQ(output, base::ASCIIToUTF16(test_case.expected_output)); 59 EXPECT_EQ(output, base::ASCIIToUTF16(test_case.expected_output));
58 } 60 }
59 } 61 }
62
63 } // namespace browsing_data_counter_utils
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698