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

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

Issue 2935443003: Properly construct 'less than' sentences (Closed)
Patch Set: fix string description Created 3 years, 6 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 <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 std::string expected_output; 48 std::string expected_output;
49 } kTestCases[] = { 49 } kTestCases[] = {
50 {42, false, false, "Less than 1 MB"}, 50 {42, false, false, "Less than 1 MB"},
51 {42, false, true, 51 {42, false, true,
52 "Frees up less than 1 MB. Some sites may load more slowly on your next " 52 "Frees up less than 1 MB. Some sites may load more slowly on your next "
53 "visit."}, 53 "visit."},
54 {2.312 * kBytesInAMegabyte, false, false, "2.3 MB"}, 54 {2.312 * kBytesInAMegabyte, false, false, "2.3 MB"},
55 {2.312 * kBytesInAMegabyte, false, true, 55 {2.312 * kBytesInAMegabyte, false, true,
56 "Frees up 2.3 MB. Some sites may load more slowly on your next visit."}, 56 "Frees up 2.3 MB. Some sites may load more slowly on your next visit."},
57 {2.312 * kBytesInAMegabyte, true, false, "Less than 2.3 MB"}, 57 {2.312 * kBytesInAMegabyte, true, false, "Less than 2.3 MB"},
58 // TODO(725401): Fix upper case L in estimate string for desktop.
59 {2.312 * kBytesInAMegabyte, true, true, 58 {2.312 * kBytesInAMegabyte, true, true,
60 "Frees up Less than 2.3 MB. Some sites may load more slowly on your " 59 "Frees up less than 2.3 MB. Some sites may load more slowly on your "
61 "next visit."}, 60 "next visit."},
62 {500.2 * kBytesInAMegabyte, false, false, "500 MB"}, 61 {500.2 * kBytesInAMegabyte, false, false, "500 MB"},
63 {500.2 * kBytesInAMegabyte, true, false, "Less than 500 MB"}, 62 {500.2 * kBytesInAMegabyte, true, false, "Less than 500 MB"},
64 }; 63 };
65 64
66 for (const TestCase& test_case : kTestCases) { 65 for (const TestCase& test_case : kTestCases) {
67 CacheCounter counter(GetProfile()); 66 CacheCounter counter(GetProfile());
68 browsing_data::ClearBrowsingDataTab tab = 67 browsing_data::ClearBrowsingDataTab tab =
69 test_case.is_basic_tab ? browsing_data::ClearBrowsingDataTab::BASIC 68 test_case.is_basic_tab ? browsing_data::ClearBrowsingDataTab::BASIC
70 : browsing_data::ClearBrowsingDataTab::ADVANCED; 69 : browsing_data::ClearBrowsingDataTab::ADVANCED;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 HostedAppsCounter::HostedAppsResult result( 116 HostedAppsCounter::HostedAppsResult result(
118 &counter, 117 &counter,
119 apps.size(), 118 apps.size(),
120 examples); 119 examples);
121 120
122 base::string16 output = GetChromeCounterTextFromResult(&result); 121 base::string16 output = GetChromeCounterTextFromResult(&result);
123 EXPECT_EQ(output, base::ASCIIToUTF16(test_case.expected_output)); 122 EXPECT_EQ(output, base::ASCIIToUTF16(test_case.expected_output));
124 } 123 }
125 } 124 }
126 #endif 125 #endif
OLDNEW
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_counter_utils.cc ('k') | components/browsing_data_strings.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698